Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/BaseAppGlobals.java

Issue 2697933002: Remove factory methods from ChromeApplication. (Closed)
Patch Set: Add some comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/BaseAppGlobals.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BaseAppGlobals.java b/chrome/android/java/src/org/chromium/chrome/browser/BaseAppGlobals.java
new file mode 100644
index 0000000000000000000000000000000000000000..40381612580d3bacd08674a7fb49b05867a156d8
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BaseAppGlobals.java
@@ -0,0 +1,204 @@
+// 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.chrome.browser.banners.AppDetailsDelegate;
+import org.chromium.chrome.browser.datausage.ExternalDataUseObserver;
+import org.chromium.chrome.browser.externalauth.ExternalAuthUtils;
+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;
+
+/**
+ * Base class for declaring factory methods to be implemented in subclasses.
+ * This class should only contain stub implementations that return null and should only contain
+ * methods that require different behavior upstream and downstream.
+ * The correct version of AppGlobals will be determined at compile time via build rules.
+ */
+public abstract class BaseAppGlobals {
+ /**
+ * Initialization-on-demand holder. This exists for thread-safe lazy initialization.
+ */
+ private static class LazyHolder { private static final AppGlobals INSTANCE = new AppGlobals(); }
agrieve 2017/02/15 19:18:44 nit: I don't think we need the extra class here. J
estevenson 2017/02/15 21:46:50 Done.
+
+ public static AppGlobals get() {
agrieve 2017/02/15 19:18:44 Since this is what people call get() on, can you c
estevenson 2017/02/15 21:46:51 Done.
+ return LazyHolder.INSTANCE;
+ }
+
+ /**
+ * Creates a new {@link AccountManagerDelegate}.
+ * @return the created {@link AccountManagerDelegate}.
+ */
+ public AccountManagerDelegate createAccountManagerDelegate() {
+ return null;
+ }
+
+ /**
+ * @return An instance of AppDetailsDelegate that can be queried about app information for the
+ * App Banner feature. Will be null if one is unavailable.
+ */
+ public AppDetailsDelegate createAppDetailsDelegate() {
+ return null;
+ }
+
+ /**
+ * Return a {@link AuthenticatorNavigationInterceptor} for the given {@link Tab}.
+ * This can be null if there are no applicable interceptor to be built.
+ */
+ public AuthenticatorNavigationInterceptor createAuthenticatorNavigationInterceptor(Tab tab) {
+ return null;
+ }
+
+ /**
+ * @return An instance of ExternalAuthUtils to be installed as a singleton.
+ */
+ public ExternalAuthUtils createExternalAuthUtils() {
+ return null;
+ }
+
+ /**
+ * @return An external observer of data use.
+ * @param nativePtr Pointer to the native ExternalDataUseObserver object.
+ */
+ public ExternalDataUseObserver createExternalDataUseObserver(long nativePtr) {
+ return null;
+ }
+
+ /**
+ * @return A provider of external estimates.
+ * @param nativePtr Pointer to the native ExternalEstimateProviderAndroid object.
+ */
+ public ExternalEstimateProviderAndroid createExternalEstimateProviderAndroid(long nativePtr) {
+ return null;
+ }
+
+ /**
+ * @return An instance of {@link FeedbackReporter} to report feedback.
+ */
+ public FeedbackReporter createFeedbackReporter() {
+ return null;
+ }
+
+ /**
+ * @return An instance of GmsCoreSyncListener to notify GmsCore of sync encryption key changes.
+ * Will be null if one is unavailable.
+ */
+ public GmsCoreSyncListener createGmsCoreSyncListener() {
+ return null;
+ }
+
+ /**
+ * @return An instance of GoogleActivityController.
+ */
+ public GoogleActivityController createGoogleActivityController() {
+ return null;
+ }
+
+ /**
+ * @return An instance of {@link GSAHelper} that handles the start point of chrome's integration
+ * with GSA.
+ */
+ public GSAHelper createGsaHelper() {
+ return null;
+ }
+
+ /**
+ * Returns a new instance of HelpAndFeedback.
+ */
+ public HelpAndFeedback createHelpAndFeedback() {
+ return null;
+ }
+
+ public InstantAppsHandler createInstantAppsHandler() {
+ return null;
+ }
+
+ /**
+ * @return An instance of {@link LocaleManager} that handles customized locale related logic.
+ */
+ public LocaleManager createLocaleManager() {
+ return null;
+ }
+
+ /**
+ * Returns an instance of LocationSettings to be installed as a singleton.
+ */
+ public LocationSettings createLocationSettings() {
+ return null;
+ }
+
+ /**
+ * @return An instance of MultiWindowUtils to be installed as a singleton.
+ */
+ public MultiWindowUtils createMultiWindowUtils() {
+ return null;
+ }
+
+ /**
+ * @return An instance of RequestGenerator to be used for Omaha XML creation. Will be null if
+ * a generator is unavailable.
+ */
+ public RequestGenerator createOmahaRequestGenerator() {
+ return null;
+ }
+
+ /**
+ * @return A new {@link PhysicalWebBleClient} instance.
+ */
+ public PhysicalWebBleClient createPhysicalWebBleClient() {
+ return null;
+ }
+
+ /**
+ * @return An instance of RevenueStats to be installed as a singleton.
+ */
+ public RevenueStats createRevenueStatsInstance() {
+ return null;
+ }
+
+ /**
+ * Returns a new instance of VariationsSession.
+ */
+ public VariationsSession createVariationsSession() {
+ return null;
+ }
+
+ /**
+ * @return An instance of VideoPersister to be installed as a singleton.
+ */
+ public VideoPersister createVideoPersister() {
+ return null;
+ }
+
+ /** Returns the singleton instance of GooglePlayWebApkInstallDelegate. */
+ public GooglePlayWebApkInstallDelegate getGooglePlayWebApkInstallDelegate() {
+ return null;
+ }
+
+ /**
+ * @return An instance of PolicyAuditor that notifies the policy system of the user's activity.
+ * Only applicable when the user has a policy active, that is tracking the activity.
+ */
+ public PolicyAuditor getPolicyAuditor() {
+ return null;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698