Search in sources :

Example 16 with ChromeApplication

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();
}
Also used : ChromeApplication(org.chromium.chrome.browser.ChromeApplication)

Example 17 with ChromeApplication

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);
}
Also used : Context(android.content.Context) ChromeApplication(org.chromium.chrome.browser.ChromeApplication) UuidBasedUniqueIdentificationGenerator(org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator) Activity(android.app.Activity) View(android.view.View) UiUtils(org.chromium.ui.UiUtils)

Aggregations

ChromeApplication (org.chromium.chrome.browser.ChromeApplication)17 PolicyAuditor (org.chromium.chrome.browser.policy.PolicyAuditor)4 Activity (android.app.Activity)3 Context (android.content.Context)3 SuppressFBWarnings (org.chromium.base.annotations.SuppressFBWarnings)3 CalledByNative (org.chromium.base.annotations.CalledByNative)2 FeedbackCollector (org.chromium.chrome.browser.feedback.FeedbackCollector)2 Intent (android.content.Intent)1 Preference (android.preference.Preference)1 OnPreferenceClickListener (android.preference.Preference.OnPreferenceClickListener)1 View (android.view.View)1 ProcessInitException (org.chromium.base.library_loader.ProcessInitException)1 DevToolsServer (org.chromium.chrome.browser.DevToolsServer)1 UuidBasedUniqueIdentificationGenerator (org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator)1 ChromeBasePreference (org.chromium.chrome.browser.preferences.ChromeBasePreference)1 SyncPreference (org.chromium.chrome.browser.preferences.SyncPreference)1 TabCreator (org.chromium.chrome.browser.tabmodel.TabCreatorManager.TabCreator)1 ChildProcessCreationParams (org.chromium.content.browser.ChildProcessCreationParams)1 PrintDocumentAdapterWrapper (org.chromium.printing.PrintDocumentAdapterWrapper)1 UiUtils (org.chromium.ui.UiUtils)1