use of org.chromium.chrome.browser.ChromeApplication in project AndroidChromium by JackyAndroid.
the class ExternalAuthUtils method getInstance.
/**
* Returns the singleton instance of ExternalAuthUtils, creating it if needed.
*/
public static ExternalAuthUtils getInstance() {
if (sInstance.get() == null) {
ChromeApplication application = (ChromeApplication) ContextUtils.getApplicationContext();
sInstance.compareAndSet(null, application.createExternalAuthUtils());
}
return sInstance.get();
}
use of org.chromium.chrome.browser.ChromeApplication in project AndroidChromium by JackyAndroid.
the class ProcessInitializationHandler method handlePreNativeInitialization.
/**
* Performs the shared class initialization.
*/
protected void handlePreNativeInitialization() {
ChromeApplication application = (ChromeApplication) ContextUtils.getApplicationContext();
UiUtils.setKeyboardShowingDelegate(new UiUtils.KeyboardShowingDelegate() {
@Override
public boolean disableKeyboardCheck(Context context, View view) {
Activity activity = null;
if (context instanceof Activity) {
activity = (Activity) context;
} else if (view != null && view.getContext() instanceof Activity) {
activity = (Activity) view.getContext();
}
// For multiwindow mode we do not track keyboard visibility.
return activity != null && MultiWindowUtils.getInstance().isLegacyMultiWindow(activity);
}
});
// Initialize the AccountManagerHelper with the correct AccountManagerDelegate. Must be done
// only once and before AccountMangerHelper.get(...) is called to avoid using the
// default AccountManagerDelegate.
AccountManagerHelper.initializeAccountManagerHelper(application, application.createAccountManagerDelegate());
// Set the unique identification generator for invalidations. The
// invalidations system can start and attempt to fetch the client ID
// very early. We need this generator to be ready before that happens.
UniqueIdInvalidationClientNameGenerator.doInitializeAndInstallGenerator(application);
// Set minimum Tango log level. This sets an in-memory static field, and needs to be
// set in the ApplicationContext instead of an activity, since Tango can be woken up
// by the system directly though messages from GCM.
AndroidLogger.setMinimumAndroidLogLevel(Log.WARN);
// Set up the identification generator for sync. The ID is actually generated
// in the SyncController constructor.
UniqueIdentificationGeneratorFactory.registerGenerator(SyncController.GENERATOR_ID, new UuidBasedUniqueIdentificationGenerator(application, SESSIONS_UUID_PREF_KEY), false);
}
Aggregations