Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/AppGlobals.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppGlobals.java b/chrome/android/java/src/org/chromium/chrome/browser/AppGlobals.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4529458acf935fe57a77574ad8192e43ff114abc |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/AppGlobals.java |
| @@ -0,0 +1,151 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser; |
| + |
| +import org.chromium.base.ContextUtils; |
| +import org.chromium.chrome.browser.banners.AppDetailsDelegate; |
| +import org.chromium.chrome.browser.datausage.ExternalDataUseObserver; |
| +import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; |
| +import org.chromium.chrome.browser.feedback.EmptyFeedbackReporter; |
| +import org.chromium.chrome.browser.feedback.FeedbackReporter; |
| +import org.chromium.chrome.browser.gsa.GSAHelper; |
| +import org.chromium.chrome.browser.help.HelpAndFeedback; |
| +import org.chromium.chrome.browser.instantapps.InstantAppsHandler; |
| +import org.chromium.chrome.browser.locale.LocaleManager; |
| +import org.chromium.chrome.browser.media.VideoPersister; |
| +import org.chromium.chrome.browser.metrics.VariationsSession; |
| +import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; |
| +import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderAndroid; |
| +import org.chromium.chrome.browser.omaha.RequestGenerator; |
| +import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; |
| +import org.chromium.chrome.browser.policy.PolicyAuditor; |
| +import org.chromium.chrome.browser.preferences.LocationSettings; |
| +import org.chromium.chrome.browser.rlz.RevenueStats; |
| +import org.chromium.chrome.browser.signin.GoogleActivityController; |
| +import org.chromium.chrome.browser.sync.GmsCoreSyncListener; |
| +import org.chromium.chrome.browser.tab.AuthenticatorNavigationInterceptor; |
| +import org.chromium.chrome.browser.tab.Tab; |
| +import org.chromium.chrome.browser.webapps.GooglePlayWebApkInstallDelegate; |
| +import org.chromium.components.signin.AccountManagerDelegate; |
| +import org.chromium.components.signin.SystemAccountManagerDelegate; |
| + |
| +/** |
| + * This class should only contain implementations for methods defined in {@link BaseAppGlobals}. |
|
agrieve
2017/02/15 19:18:44
nit: can you add a link to the crbug that explains
estevenson
2017/02/15 21:46:50
Done.
|
| + */ |
| +public class AppGlobals extends BaseAppGlobals { |
| + @Override |
| + public AccountManagerDelegate createAccountManagerDelegate() { |
| + return new SystemAccountManagerDelegate(ContextUtils.getApplicationContext()); |
| + } |
| + |
| + @Override |
| + public AppDetailsDelegate createAppDetailsDelegate() { |
| + return null; |
| + } |
| + |
| + @Override |
| + public AuthenticatorNavigationInterceptor createAuthenticatorNavigationInterceptor(Tab tab) { |
| + return null; |
| + } |
| + |
| + @Override |
| + public ExternalAuthUtils createExternalAuthUtils() { |
| + return new ExternalAuthUtils(); |
| + } |
| + |
| + @Override |
| + public ExternalDataUseObserver createExternalDataUseObserver(long nativePtr) { |
| + return new ExternalDataUseObserver(nativePtr); |
| + } |
| + |
| + @Override |
| + public ExternalEstimateProviderAndroid createExternalEstimateProviderAndroid(long nativePtr) { |
| + return new ExternalEstimateProviderAndroid(nativePtr) {}; |
| + } |
| + |
| + @Override |
| + public FeedbackReporter createFeedbackReporter() { |
| + return new EmptyFeedbackReporter(); |
| + } |
| + |
| + @Override |
| + public GmsCoreSyncListener createGmsCoreSyncListener() { |
| + return null; |
| + } |
| + |
| + @Override |
| + public GoogleActivityController createGoogleActivityController() { |
| + return new GoogleActivityController(); |
| + } |
| + |
| + @Override |
| + public GSAHelper createGsaHelper() { |
| + return new GSAHelper(); |
| + } |
| + |
| + @Override |
| + public HelpAndFeedback createHelpAndFeedback() { |
| + return new HelpAndFeedback(); |
| + } |
| + |
| + @Override |
| + public InstantAppsHandler createInstantAppsHandler() { |
| + return new InstantAppsHandler(); |
| + } |
| + |
| + @Override |
| + public LocaleManager createLocaleManager() { |
| + return new LocaleManager(); |
| + } |
| + |
| + @Override |
| + public LocationSettings createLocationSettings() { |
| + // Using an anonymous subclass as the constructor is protected. |
| + // This is done to deter instantiation of LocationSettings elsewhere without using the |
| + // getInstance() helper method. |
| + return new LocationSettings() {}; |
| + } |
| + |
| + @Override |
| + public MultiWindowUtils createMultiWindowUtils() { |
| + return new MultiWindowUtils(); |
| + } |
| + |
| + @Override |
| + public RequestGenerator createOmahaRequestGenerator() { |
| + return null; |
| + } |
| + |
| + @Override |
| + public PhysicalWebBleClient createPhysicalWebBleClient() { |
| + return new PhysicalWebBleClient(); |
| + } |
| + |
| + @Override |
| + public RevenueStats createRevenueStatsInstance() { |
| + return new RevenueStats(); |
| + } |
| + |
| + @Override |
| + public VariationsSession createVariationsSession() { |
| + return new VariationsSession(); |
| + } |
| + |
| + @Override |
| + public VideoPersister createVideoPersister() { |
| + return new VideoPersister(); |
| + } |
| + |
| + @Override |
| + public GooglePlayWebApkInstallDelegate getGooglePlayWebApkInstallDelegate() { |
| + return null; |
| + } |
| + |
| + @Override |
| + public PolicyAuditor getPolicyAuditor() { |
| + // This class has a protected constructor to prevent accidental instantiation. |
| + return new PolicyAuditor() {}; |
| + } |
| +} |