Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
index e04d2cfb274bf3234c42d4b4d58565ad670dc916..43e14357692470942873a71df6b2a31d5c23beba 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java |
@@ -37,56 +37,56 @@ import org.chromium.base.library_loader.LibraryProcessType; |
import org.chromium.base.library_loader.ProcessInitException; |
import org.chromium.base.metrics.RecordHistogram; |
import org.chromium.chrome.R; |
-import org.chromium.chrome.browser.accessibility.FontSizePrefs; |
-import org.chromium.chrome.browser.banners.AppBannerManager; |
-import org.chromium.chrome.browser.banners.AppDetailsDelegate; |
-import org.chromium.chrome.browser.customtabs.CustomTabsConnection; |
-import org.chromium.chrome.browser.document.DocumentActivity; |
-import org.chromium.chrome.browser.document.IncognitoDocumentActivity; |
-import org.chromium.chrome.browser.download.DownloadManagerService; |
-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.identity.UniqueIdentificationGeneratorFactory; |
-import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; |
+//import org.chromium.chrome.browser.accessibility.FontSizePrefs; |
+//import org.chromium.chrome.browser.banners.AppBannerManager; |
+//import org.chromium.chrome.browser.banners.AppDetailsDelegate; |
+//import org.chromium.chrome.browser.customtabs.CustomTabsConnection; |
+//import org.chromium.chrome.browser.document.DocumentActivity; |
+//import org.chromium.chrome.browser.document.IncognitoDocumentActivity; |
+//import org.chromium.chrome.browser.download.DownloadManagerService; |
+//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.identity.UniqueIdentificationGeneratorFactory; |
+//import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; |
import org.chromium.chrome.browser.init.InvalidStartupDialog; |
-import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGenerator; |
-import org.chromium.chrome.browser.metrics.UmaUtils; |
-import org.chromium.chrome.browser.metrics.VariationsSession; |
-import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; |
-import org.chromium.chrome.browser.net.qualityprovider.NetworkQualityProvider; |
-import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
-import org.chromium.chrome.browser.omaha.RequestGenerator; |
-import org.chromium.chrome.browser.omaha.UpdateInfoBarHelper; |
-import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; |
-import org.chromium.chrome.browser.policy.PolicyAuditor; |
-import org.chromium.chrome.browser.preferences.AccessibilityPreferences; |
-import org.chromium.chrome.browser.preferences.LocationSettings; |
-import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
-import org.chromium.chrome.browser.preferences.Preferences; |
-import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
-import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; |
-import org.chromium.chrome.browser.preferences.password.SavePasswordsPreferences; |
-import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferences; |
-import org.chromium.chrome.browser.preferences.website.SingleWebsitePreferences; |
-import org.chromium.chrome.browser.printing.PrintingControllerFactory; |
-import org.chromium.chrome.browser.rlz.RevenueStats; |
-import org.chromium.chrome.browser.services.AndroidEduOwnerCheckCallback; |
-import org.chromium.chrome.browser.services.GoogleServicesManager; |
-import org.chromium.chrome.browser.share.ShareHelper; |
-import org.chromium.chrome.browser.smartcard.EmptyPKCS11AuthenticationManager; |
-import org.chromium.chrome.browser.smartcard.PKCS11AuthenticationManager; |
-import org.chromium.chrome.browser.sync.SyncController; |
-import org.chromium.chrome.browser.tab.AuthenticatorNavigationInterceptor; |
-import org.chromium.chrome.browser.tab.Tab; |
-import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
-import org.chromium.chrome.browser.tabmodel.document.ActivityDelegateImpl; |
-import org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector; |
-import org.chromium.chrome.browser.tabmodel.document.StorageDelegate; |
-import org.chromium.chrome.browser.tabmodel.document.TabDelegate; |
-import org.chromium.chrome.browser.util.FeatureUtilities; |
+//import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGenerator; |
+//import org.chromium.chrome.browser.metrics.UmaUtils; |
+//import org.chromium.chrome.browser.metrics.VariationsSession; |
+//import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; |
+//import org.chromium.chrome.browser.net.qualityprovider.NetworkQualityProvider; |
+//import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
+//import org.chromium.chrome.browser.omaha.RequestGenerator; |
+//import org.chromium.chrome.browser.omaha.UpdateInfoBarHelper; |
+//import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; |
+//import org.chromium.chrome.browser.policy.PolicyAuditor; |
+//import org.chromium.chrome.browser.preferences.AccessibilityPreferences; |
+//import org.chromium.chrome.browser.preferences.LocationSettings; |
+//import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
+//import org.chromium.chrome.browser.preferences.Preferences; |
+//import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
+//import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; |
+//import org.chromium.chrome.browser.preferences.password.SavePasswordsPreferences; |
+//import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferences; |
+//import org.chromium.chrome.browser.preferences.website.SingleWebsitePreferences; |
+//import org.chromium.chrome.browser.printing.PrintingControllerFactory; |
+//import org.chromium.chrome.browser.rlz.RevenueStats; |
+//import org.chromium.chrome.browser.services.AndroidEduOwnerCheckCallback; |
+//import org.chromium.chrome.browser.services.GoogleServicesManager; |
+//import org.chromium.chrome.browser.share.ShareHelper; |
+//import org.chromium.chrome.browser.smartcard.EmptyPKCS11AuthenticationManager; |
+//import org.chromium.chrome.browser.smartcard.PKCS11AuthenticationManager; |
+//import org.chromium.chrome.browser.sync.SyncController; |
+//import org.chromium.chrome.browser.tab.AuthenticatorNavigationInterceptor; |
+//import org.chromium.chrome.browser.tab.Tab; |
+//import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
+//import org.chromium.chrome.browser.tabmodel.document.ActivityDelegateImpl; |
+//import org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector; |
+//import org.chromium.chrome.browser.tabmodel.document.StorageDelegate; |
+//import org.chromium.chrome.browser.tabmodel.document.TabDelegate; |
+//import org.chromium.chrome.browser.util.FeatureUtilities; |
import org.chromium.content.app.ContentApplication; |
import org.chromium.content.browser.BrowserStartupController; |
import org.chromium.content.browser.ChildProcessLauncher; |
@@ -122,7 +122,7 @@ public class ChromeApplication extends ContentApplication { |
private static final String DEV_TOOLS_SERVER_SOCKET_PREFIX = "chrome"; |
private static final String SESSIONS_UUID_PREF_KEY = "chromium.sync.sessions.id"; |
- private static DocumentTabModelSelector sDocumentTabModelSelector; |
+// private static DocumentTabModelSelector sDocumentTabModelSelector; |
/** |
* This class allows pausing scripts & network connections when we |
@@ -172,13 +172,13 @@ public class ChromeApplication extends ContentApplication { |
} |
private final BackgroundProcessing mBackgroundProcessing = new BackgroundProcessing(); |
- private final PowerBroadcastReceiver mPowerBroadcastReceiver = new PowerBroadcastReceiver(); |
- private final UpdateInfoBarHelper mUpdateInfoBarHelper = new UpdateInfoBarHelper(); |
+// private final PowerBroadcastReceiver mPowerBroadcastReceiver = new PowerBroadcastReceiver(); |
+// private final UpdateInfoBarHelper mUpdateInfoBarHelper = new UpdateInfoBarHelper(); |
// Used to trigger variation changes (such as seed fetches) upon application foregrounding. |
- private VariationsSession mVariationsSession; |
+// private VariationsSession mVariationsSession; |
- private DevToolsServer mDevToolsServer; |
+// private DevToolsServer mDevToolsServer; |
private boolean mIsStarted; |
private boolean mInitializedSharedClasses; |
@@ -194,7 +194,7 @@ public class ChromeApplication extends ContentApplication { |
*/ |
@Override |
public void onCreate() { |
- UmaUtils.recordMainEntryPointTime(); |
+// UmaUtils.recordMainEntryPointTime(); |
super.onCreate(); |
UiUtils.setKeyboardShowingDelegate(new UiUtils.KeyboardShowingDelegate() { |
@Override |
@@ -207,7 +207,7 @@ public class ChromeApplication extends ContentApplication { |
} |
// For multiwindow mode we do not track keyboard visibility. |
- return activity != null && MultiWindowUtils.getInstance().isMultiWindow(activity); |
+ return activity != null;// && MultiWindowUtils.getInstance().isMultiWindow(activity); |
} |
}); |
@@ -219,7 +219,7 @@ public class ChromeApplication extends ContentApplication { |
// 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(this); |
+// UniqueIdInvalidationClientNameGenerator.doInitializeAndInstallGenerator(this); |
// 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 |
@@ -228,8 +228,8 @@ public class ChromeApplication extends ContentApplication { |
// Set up the identification generator for sync. The ID is actually generated |
// in the SyncController constructor. |
- UniqueIdentificationGeneratorFactory.registerGenerator(SyncController.GENERATOR_ID, |
- new UuidBasedUniqueIdentificationGenerator(this, SESSIONS_UUID_PREF_KEY), false); |
+// UniqueIdentificationGeneratorFactory.registerGenerator(SyncController.GENERATOR_ID, |
+// new UuidBasedUniqueIdentificationGenerator(this, SESSIONS_UUID_PREF_KEY), false); |
} |
/** |
@@ -259,12 +259,12 @@ public class ChromeApplication extends ContentApplication { |
mBackgroundProcessing.startTimers(); |
updatePasswordEchoState(); |
updateFontSize(); |
- updateAcceptLanguages(); |
+// updateAcceptLanguages(); |
changeAppStatus(true); |
- mVariationsSession.start(getApplicationContext()); |
+// mVariationsSession.start(getApplicationContext()); |
- mPowerBroadcastReceiver.registerReceiver(this); |
- mPowerBroadcastReceiver.runActions(this, true); |
+// mPowerBroadcastReceiver.registerReceiver(this); |
+// mPowerBroadcastReceiver.runActions(this, true); |
} |
/** |
@@ -280,35 +280,35 @@ public class ChromeApplication extends ContentApplication { |
mIsStarted = false; |
changeAppStatus(false); |
- try { |
- mPowerBroadcastReceiver.unregisterReceiver(this); |
- } catch (IllegalArgumentException e) { |
- // This may happen when onStop get called very early in UI test. |
- } |
+// try { |
+// mPowerBroadcastReceiver.unregisterReceiver(this); |
+// } catch (IllegalArgumentException e) { |
+// // This may happen when onStop get called very early in UI test. |
+// } |
ChildProcessLauncher.onSentToBackground(); |
IntentHandler.clearPendingReferrer(); |
- if (FeatureUtilities.isDocumentMode(this)) { |
- if (sDocumentTabModelSelector != null) { |
- RecordHistogram.recordCountHistogram("Tab.TotalTabCount.BeforeLeavingApp", |
- sDocumentTabModelSelector.getTotalTabCount()); |
- } |
- } else { |
- int totalTabCount = 0; |
- for (WeakReference<Activity> reference : ApplicationStatus.getRunningActivities()) { |
- Activity activity = reference.get(); |
- if (activity instanceof ChromeActivity) { |
- TabModelSelector tabModelSelector = |
- ((ChromeActivity) activity).getTabModelSelector(); |
- if (tabModelSelector != null) { |
- totalTabCount += tabModelSelector.getTotalTabCount(); |
- } |
- } |
- } |
- RecordHistogram.recordCountHistogram( |
- "Tab.TotalTabCount.BeforeLeavingApp", totalTabCount); |
- } |
+// if (FeatureUtilities.isDocumentMode(this)) { |
+// if (sDocumentTabModelSelector != null) { |
+// RecordHistogram.recordCountHistogram("Tab.TotalTabCount.BeforeLeavingApp", |
+// sDocumentTabModelSelector.getTotalTabCount()); |
+// } |
+// } else { |
+// int totalTabCount = 0; |
+// for (WeakReference<Activity> reference : ApplicationStatus.getRunningActivities()) { |
+// Activity activity = reference.get(); |
+// if (activity instanceof ChromeActivity) { |
+// TabModelSelector tabModelSelector = |
+// ((ChromeActivity) activity).getTabModelSelector(); |
+// if (tabModelSelector != null) { |
+// totalTabCount += tabModelSelector.getTotalTabCount(); |
+// } |
+// } |
+// } |
+// RecordHistogram.recordCountHistogram( |
+// "Tab.TotalTabCount.BeforeLeavingApp", totalTabCount); |
+// } |
} |
/** |
@@ -319,8 +319,8 @@ public class ChromeApplication extends ContentApplication { |
if (ApplicationStatus.isEveryActivityDestroyed()) { |
mBackgroundProcessing.onDestroy(); |
stopApplicationActivityTracker(); |
- PartnerBrowserCustomizations.destroy(); |
- ShareHelper.clearSharedScreenshots(this); |
+// PartnerBrowserCustomizations.destroy(); |
+// ShareHelper.clearSharedScreenshots(this); |
CombinedPolicyProvider.get().destroy(); |
} |
} |
@@ -339,20 +339,20 @@ public class ChromeApplication extends ContentApplication { |
} |
/** |
- * Returns a new instance of VariationsSession. |
- */ |
- public VariationsSession createVariationsSession() { |
- return new VariationsSession(); |
- } |
+// * Returns a new instance of VariationsSession. |
+// */ |
+// public VariationsSession createVariationsSession() { |
+// return new VariationsSession(); |
+// } |
- /** |
- * Return a {@link AuthenticatorNavigationInterceptor} for the given {@link Tab}. |
- * This can be null if there are no applicable interceptor to be built. |
- */ |
- @SuppressWarnings("unused") |
- public AuthenticatorNavigationInterceptor createAuthenticatorNavigationInterceptor(Tab tab) { |
- return null; |
- } |
+// /** |
+// * Return a {@link AuthenticatorNavigationInterceptor} for the given {@link Tab}. |
+// * This can be null if there are no applicable interceptor to be built. |
+// */ |
+// @SuppressWarnings("unused") |
+// public AuthenticatorNavigationInterceptor createAuthenticatorNavigationInterceptor(Tab tab) { |
+// return null; |
+// } |
/** |
* Starts the application activity tracker. |
@@ -368,23 +368,23 @@ public class ChromeApplication extends ContentApplication { |
* Initiate AndroidEdu device check. |
* @param callback Callback that should receive the results of the AndroidEdu device check. |
*/ |
- public void checkIsAndroidEduDevice(final AndroidEduOwnerCheckCallback callback) { |
- new Handler(Looper.getMainLooper()).post(new Runnable() { |
- @Override |
- public void run() { |
- callback.onSchoolCheckDone(false); |
- } |
- }); |
- } |
+// public void checkIsAndroidEduDevice(final AndroidEduOwnerCheckCallback callback) { |
+// new Handler(Looper.getMainLooper()).post(new Runnable() { |
+// @Override |
+// public void run() { |
+// callback.onSchoolCheckDone(false); |
+// } |
+// }); |
+// } |
/** |
* Returns the class name of the Settings activity. |
* |
* TODO(newt): delete this when ChromeShell is deleted. |
*/ |
- public String getSettingsActivityName() { |
- return Preferences.class.getName(); |
- } |
+// public String getSettingsActivityName() { |
+// return Preferences.class.getName(); |
+// } |
/** |
* Open Chrome Sync settings page. |
@@ -394,17 +394,17 @@ public class ChromeApplication extends ContentApplication { |
// TODO(aurimas): implement this once SyncCustomizationFragment is upstreamed. |
} |
- @CalledByNative |
- protected void showAutofillSettings() { |
- PreferencesLauncher.launchSettingsPage(this, |
- AutofillPreferences.class.getName()); |
- } |
- |
- @CalledByNative |
- protected void showPasswordSettings() { |
- PreferencesLauncher.launchSettingsPage(this, |
- SavePasswordsPreferences.class.getName()); |
- } |
+// @CalledByNative |
+// protected void showAutofillSettings() { |
+// PreferencesLauncher.launchSettingsPage(this, |
+// AutofillPreferences.class.getName()); |
+// } |
+// |
+// @CalledByNative |
+// protected void showPasswordSettings() { |
+// PreferencesLauncher.launchSettingsPage(this, |
+// SavePasswordsPreferences.class.getName()); |
+// } |
/** |
* Opens the single origin settings page for the given URL. |
@@ -412,13 +412,13 @@ public class ChromeApplication extends ContentApplication { |
* @param url The URL to show the single origin settings for. This is a complete url |
* including scheme, domain, port, path, etc. |
*/ |
- protected void showSingleOriginSettings(String url) { |
- Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(url); |
- Intent intent = PreferencesLauncher.createIntentForSettingsPage( |
- this, SingleWebsitePreferences.class.getName()); |
- intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs); |
- startActivity(intent); |
- } |
+// protected void showSingleOriginSettings(String url) { |
+// Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(url); |
+// Intent intent = PreferencesLauncher.createIntentForSettingsPage( |
+// this, SingleWebsitePreferences.class.getName()); |
+// intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs); |
+// startActivity(intent); |
+// } |
@Override |
protected void initializeLibraryDependencies() { |
@@ -439,24 +439,24 @@ public class ChromeApplication extends ContentApplication { |
if (mInitializedSharedClasses) return; |
mInitializedSharedClasses = true; |
- GoogleServicesManager.get(this).onMainActivityStart(); |
- SyncController.get(this).onMainActivityStart(); |
- RevenueStats.getInstance(); |
- |
- getPKCS11AuthenticationManager().initialize(ChromeApplication.this); |
- |
- mDevToolsServer = new DevToolsServer(DEV_TOOLS_SERVER_SOCKET_PREFIX); |
- mDevToolsServer.setRemoteDebuggingEnabled( |
- true, DevToolsServer.Security.ALLOW_DEBUG_PERMISSION); |
+// GoogleServicesManager.get(this).onMainActivityStart(); |
+// SyncController.get(this).onMainActivityStart(); |
+// RevenueStats.getInstance(); |
+// |
+// getPKCS11AuthenticationManager().initialize(ChromeApplication.this); |
+// |
+// mDevToolsServer = new DevToolsServer(DEV_TOOLS_SERVER_SOCKET_PREFIX); |
+// mDevToolsServer.setRemoteDebuggingEnabled( |
+// true, DevToolsServer.Security.ALLOW_DEBUG_PERMISSION); |
startApplicationActivityTracker(); |
- DownloadController.setDownloadNotificationService( |
- DownloadManagerService.getDownloadManagerService(this)); |
+// DownloadController.setDownloadNotificationService( |
+// DownloadManagerService.getDownloadManagerService(this)); |
- if (ApiCompatibilityUtils.isPrintingSupported()) { |
- mPrintingController = PrintingControllerFactory.create(getApplicationContext()); |
- } |
+// if (ApiCompatibilityUtils.isPrintingSupported()) { |
+// mPrintingController = PrintingControllerFactory.create(getApplicationContext()); |
+// } |
} |
/** |
@@ -469,15 +469,15 @@ public class ChromeApplication extends ContentApplication { |
mIsProcessInitialized = true; |
assert !mIsStarted; |
- DataReductionProxySettings.reconcileDataReductionProxyEnabledState(getApplicationContext()); |
+// DataReductionProxySettings.reconcileDataReductionProxyEnabledState(getApplicationContext()); |
- mVariationsSession = createVariationsSession(); |
+// mVariationsSession = createVariationsSession(); |
removeSessionCookies(); |
ApplicationStatus.registerApplicationStateListener(createApplicationStateListener()); |
- AppBannerManager.setAppDetailsDelegate(createAppDetailsDelegate()); |
+// AppBannerManager.setAppDetailsDelegate(createAppDetailsDelegate()); |
mChromeLifetimeController = new ChromeLifetimeController(this); |
- PrefServiceBridge.getInstance().migratePreferences(this); |
+// PrefServiceBridge.getInstance().migratePreferences(this); |
} |
@Override |
@@ -502,7 +502,7 @@ public class ChromeApplication extends ContentApplication { |
// before starting the browser process. |
registerPolicyProviders(CombinedPolicyProvider.get()); |
Context applicationContext = getApplicationContext(); |
- BrowserStartupController.get(applicationContext, LibraryProcessType.PROCESS_BROWSER) |
+ BrowserStartupController.get(applicationContext, LibraryProcessType.PROCESS_BROWSER, true) |
.startBrowserProcessesAsync(callback); |
} |
@@ -524,11 +524,11 @@ public class ChromeApplication extends ContentApplication { |
// The policies are used by browser startup, so we need to register the policy providers |
// before starting the browser process. |
registerPolicyProviders(CombinedPolicyProvider.get()); |
- BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER) |
+ BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER, true) |
.startBrowserProcessesSync(false); |
- if (initGoogleServicesManager) { |
- GoogleServicesManager.get(getApplicationContext()); |
- } |
+// if (initGoogleServicesManager) { |
+// GoogleServicesManager.get(getApplicationContext()); |
+// } |
} |
/** |
@@ -546,40 +546,20 @@ public class ChromeApplication extends ContentApplication { |
/** |
* Returns an instance of LocationSettings to be installed as a singleton. |
*/ |
- 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(this){}; |
- } |
+// 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(this){}; |
+// } |
/** |
* @return The Application's PowerBroadcastReceiver. |
*/ |
- @VisibleForTesting |
- public PowerBroadcastReceiver getPowerBroadcastReceiver() { |
- return mPowerBroadcastReceiver; |
- } |
- |
- /** |
- * Opens the UI to clear browsing data. |
- * @param tab The tab that triggered the request. |
- */ |
- @CalledByNative |
- protected void openClearBrowsingData(Tab tab) { |
- Activity activity = tab.getWindowAndroid().getActivity().get(); |
- if (activity == null) { |
- Log.e(TAG, |
- "Attempting to open clear browsing data for a tab without a valid activity"); |
- return; |
- } |
- Intent intent = PreferencesLauncher.createIntentForSettingsPage(activity, |
- PrivacyPreferences.class.getName()); |
- Bundle arguments = new Bundle(); |
- arguments.putBoolean(PrivacyPreferences.SHOW_CLEAR_BROWSING_DATA_EXTRA, true); |
- intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, arguments); |
- activity.startActivity(intent); |
- } |
+// @VisibleForTesting |
+// public PowerBroadcastReceiver getPowerBroadcastReceiver() { |
+// return mPowerBroadcastReceiver; |
+// } |
/** |
* @return Whether parental controls are enabled. Returning true will disable |
@@ -587,21 +567,22 @@ public class ChromeApplication extends ContentApplication { |
*/ |
@CalledByNative |
protected boolean areParentalControlsEnabled() { |
- return PartnerBrowserCustomizations.isIncognitoDisabled(); |
+ return false; |
+// return PartnerBrowserCustomizations.isIncognitoDisabled(); |
} |
// TODO(yfriedman): This is too widely available. Plumb this through ChromeNetworkDelegate |
// instead. |
- protected PKCS11AuthenticationManager getPKCS11AuthenticationManager() { |
- return EmptyPKCS11AuthenticationManager.getInstance(); |
- } |
+// protected PKCS11AuthenticationManager getPKCS11AuthenticationManager() { |
+// return EmptyPKCS11AuthenticationManager.getInstance(); |
+// } |
/** |
* @return A provider of network quality. |
*/ |
- public NetworkQualityProvider createNetworkQualityProvider() { |
- return new NetworkQualityProvider(); |
- } |
+// public NetworkQualityProvider createNetworkQualityProvider() { |
+// return new NetworkQualityProvider(); |
+// } |
/** |
* @return The user agent string of Chrome. |
@@ -660,39 +641,39 @@ public class ChromeApplication extends ContentApplication { |
/** |
* @return An instance of {@link FeedbackReporter} to report feedback. |
*/ |
- public FeedbackReporter createFeedbackReporter() { |
- return new EmptyFeedbackReporter(); |
- } |
- |
- /** |
- * @return An instance of ExternalAuthUtils to be installed as a singleton. |
- */ |
- public ExternalAuthUtils createExternalAuthUtils() { |
- return new ExternalAuthUtils(); |
- } |
- |
- /** |
- * Returns a new instance of HelpAndFeedback. |
- */ |
- public HelpAndFeedback createHelpAndFeedback() { |
- return new HelpAndFeedback(); |
- } |
+// public FeedbackReporter createFeedbackReporter() { |
+// return new EmptyFeedbackReporter(); |
+// } |
+// |
+// /** |
+// * @return An instance of ExternalAuthUtils to be installed as a singleton. |
+// */ |
+// public ExternalAuthUtils createExternalAuthUtils() { |
+// return new ExternalAuthUtils(); |
+// } |
+// |
+// /** |
+// * Returns a new instance of HelpAndFeedback. |
+// */ |
+// public HelpAndFeedback createHelpAndFeedback() { |
+// return new HelpAndFeedback(); |
+// } |
/** |
* @return A new ActivityWindowAndroid instance. |
*/ |
- public ActivityWindowAndroid createActivityWindowAndroid(Activity activity) { |
- if (activity instanceof ChromeActivity) return new ChromeWindow((ChromeActivity) activity); |
- return new ActivityWindowAndroid(activity); |
- } |
+// public ActivityWindowAndroid createActivityWindowAndroid(Activity activity) { |
+// if (activity instanceof ChromeActivity) return new ChromeWindow((ChromeActivity) activity); |
+// return new ActivityWindowAndroid(activity); |
+// } |
/** |
* @return An instance of {@link CustomTabsConnection}. Should not be called |
* outside of {@link CustomTabsConnection#getInstance()}. |
*/ |
- public CustomTabsConnection createCustomTabsConnection() { |
- return new CustomTabsConnection(this); |
- } |
+// public CustomTabsConnection createCustomTabsConnection() { |
+// return new CustomTabsConnection(this); |
+// } |
/** |
* @return Instance of printing controller that is shared among all chromium activities. May |
@@ -705,18 +686,18 @@ public class ChromeApplication extends ContentApplication { |
/** |
* @return The UpdateInfoBarHelper used to inform the user about updates. |
*/ |
- public UpdateInfoBarHelper getUpdateInfoBarHelper() { |
- // TODO(aurimas): make UpdateInfoBarHelper have its own static instance. |
- return mUpdateInfoBarHelper; |
- } |
+// public UpdateInfoBarHelper getUpdateInfoBarHelper() { |
+// // TODO(aurimas): make UpdateInfoBarHelper have its own static instance. |
+// return mUpdateInfoBarHelper; |
+// } |
/** |
* @return An instance of {@link GSAHelper} that handles the start point of chrome's integration |
* with GSA. |
*/ |
- public GSAHelper createGsaHelper() { |
- return new GSAHelper(); |
- } |
+// public GSAHelper createGsaHelper() { |
+// return new GSAHelper(); |
+// } |
/** |
* Registers various policy providers with the policy manager. |
@@ -746,33 +727,33 @@ public class ChromeApplication extends ContentApplication { |
* @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() { |
- // This class has a protected constructor to prevent accidental instantiation. |
- return new PolicyAuditor() {}; |
- } |
- |
- /** |
- * @return An instance of MultiWindowUtils to be installed as a singleton. |
- */ |
- public MultiWindowUtils createMultiWindowUtils() { |
- return new MultiWindowUtils(); |
- } |
+// public PolicyAuditor getPolicyAuditor() { |
+// // This class has a protected constructor to prevent accidental instantiation. |
+// return new PolicyAuditor() {}; |
+// } |
+// |
+// /** |
+// * @return An instance of MultiWindowUtils to be installed as a singleton. |
+// */ |
+// public MultiWindowUtils createMultiWindowUtils() { |
+// return new MultiWindowUtils(); |
+// } |
/** |
* @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; |
- } |
+// public RequestGenerator createOmahaRequestGenerator() { |
+// 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. |
*/ |
- protected AppDetailsDelegate createAppDetailsDelegate() { |
- return null; |
- } |
+// protected AppDetailsDelegate createAppDetailsDelegate() { |
+// return null; |
+// } |
/** |
* Returns the Singleton instance of the DocumentTabModelSelector. |
@@ -780,32 +761,32 @@ public class ChromeApplication extends ContentApplication { |
* application-level TabModelSelectors. |
* @return The DocumentTabModelSelector for the application. |
*/ |
- @SuppressFBWarnings("LI_LAZY_INIT_STATIC") |
- public static DocumentTabModelSelector getDocumentTabModelSelector() { |
- ThreadUtils.assertOnUiThread(); |
- if (sDocumentTabModelSelector == null) { |
- ActivityDelegateImpl activityDelegate = new ActivityDelegateImpl( |
- DocumentActivity.class, IncognitoDocumentActivity.class); |
- sDocumentTabModelSelector = new DocumentTabModelSelector(activityDelegate, |
- new StorageDelegate(), new TabDelegate(false), new TabDelegate(true)); |
- } |
- return sDocumentTabModelSelector; |
- } |
+// @SuppressFBWarnings("LI_LAZY_INIT_STATIC") |
+// public static DocumentTabModelSelector getDocumentTabModelSelector() { |
+// ThreadUtils.assertOnUiThread(); |
+// if (sDocumentTabModelSelector == null) { |
+// ActivityDelegateImpl activityDelegate = new ActivityDelegateImpl( |
+// DocumentActivity.class, IncognitoDocumentActivity.class); |
+// sDocumentTabModelSelector = new DocumentTabModelSelector(activityDelegate, |
+// new StorageDelegate(), new TabDelegate(false), new TabDelegate(true)); |
+// } |
+// return sDocumentTabModelSelector; |
+// } |
/** |
* @return Whether or not the Singleton has been initialized. |
*/ |
- @VisibleForTesting |
- public static boolean isDocumentTabModelSelectorInitializedForTests() { |
- return sDocumentTabModelSelector != null; |
- } |
+// @VisibleForTesting |
+// public static boolean isDocumentTabModelSelectorInitializedForTests() { |
+// return sDocumentTabModelSelector != null; |
+// } |
/** |
* @return An instance of RevenueStats to be installed as a singleton. |
*/ |
- public RevenueStats createRevenueStatsInstance() { |
- return new RevenueStats(); |
- } |
+// public RevenueStats createRevenueStatsInstance() { |
+// return new RevenueStats(); |
+// } |
/** |
* Creates a new {@link AccountManagerDelegate}. |
@@ -827,27 +808,27 @@ public class ChromeApplication extends ContentApplication { |
// TODO(newt): fix this. |
if (true) return; |
- FontSizePrefs fontSizePrefs = FontSizePrefs.getInstance(getApplicationContext()); |
+// FontSizePrefs fontSizePrefs = FontSizePrefs.getInstance(getApplicationContext()); |
// Set font scale factor as the product of the system and browser scale settings. |
- float browserTextScale = PreferenceManager |
- .getDefaultSharedPreferences(this) |
- .getFloat(AccessibilityPreferences.PREF_TEXT_SCALE, 1.0f); |
- float fontScale = getResources().getConfiguration().fontScale * browserTextScale; |
- |
- float scaleDelta = Math.abs(fontScale - fontSizePrefs.getFontScaleFactor()); |
- if (scaleDelta >= FLOAT_EPSILON) { |
- fontSizePrefs.setFontScaleFactor(fontScale); |
- } |
+// float browserTextScale = PreferenceManager |
+// .getDefaultSharedPreferences(this) |
+// .getFloat(AccessibilityPreferences.PREF_TEXT_SCALE, 1.0f); |
+// float fontScale = getResources().getConfiguration().fontScale * browserTextScale; |
+ |
+// float scaleDelta = Math.abs(fontScale - fontSizePrefs.getFontScaleFactor()); |
+// if (scaleDelta >= FLOAT_EPSILON) { |
+// fontSizePrefs.setFontScaleFactor(fontScale); |
+// } |
// If force enable zoom has not been manually set, set it automatically based on |
// font scale factor. |
- boolean shouldForceZoom = |
- fontScale >= AccessibilityPreferences.FORCE_ENABLE_ZOOM_THRESHOLD_MULTIPLIER; |
- if (!fontSizePrefs.getUserSetForceEnableZoom() |
- && fontSizePrefs.getForceEnableZoom() != shouldForceZoom) { |
- fontSizePrefs.setForceEnableZoom(shouldForceZoom); |
- } |
+// boolean shouldForceZoom = |
+// fontScale >= AccessibilityPreferences.FORCE_ENABLE_ZOOM_THRESHOLD_MULTIPLIER; |
+// if (!fontSizePrefs.getUserSetForceEnableZoom() |
+// && fontSizePrefs.getForceEnableZoom() != shouldForceZoom) { |
+// fontSizePrefs.setForceEnableZoom(shouldForceZoom); |
+// } |
} |
/** |
@@ -855,19 +836,19 @@ public class ChromeApplication extends ContentApplication { |
* Activities but it doesn't kill the ChromeApplication, so this should be called in |
* {@link #onStart} instead of {@link #initialize}. |
*/ |
- private void updateAcceptLanguages() { |
- PrefServiceBridge instance = PrefServiceBridge.getInstance(); |
- String localeString = Locale.getDefault().toString(); // ex) en_US, de_DE, zh_CN_#Hans |
- if (hasLocaleChanged(localeString)) { |
- instance.resetAcceptLanguages(localeString); |
- // Clear cache so that accept-languages change can be applied immediately. |
- // TODO(changwan): The underlying BrowsingDataRemover::Remove() is an asynchronous call. |
- // So cache-clearing may not be effective if URL rendering can happen before |
- // OnBrowsingDataRemoverDone() is called, in which case we may have to reload as well. |
- // Check if it can happen. |
- instance.clearBrowsingData(null, false, true /* cache */, false, false, false); |
- } |
- } |
+// private void updateAcceptLanguages() { |
+//// PrefServiceBridge instance = PrefServiceBridge.getInstance(); |
+// String localeString = Locale.getDefault().toString(); // ex) en_US, de_DE, zh_CN_#Hans |
+// if (hasLocaleChanged(localeString)) { |
+// instance.resetAcceptLanguages(localeString); |
+// // Clear cache so that accept-languages change can be applied immediately. |
+// // TODO(changwan): The underlying BrowsingDataRemover::Remove() is an asynchronous call. |
+// // So cache-clearing may not be effective if URL rendering can happen before |
+// // OnBrowsingDataRemoverDone() is called, in which case we may have to reload as well. |
+// // Check if it can happen. |
+// instance.clearBrowsingData(null, false, true /* cache */, false, false, false); |
+// } |
+// } |
private boolean hasLocaleChanged(String newLocale) { |
String previousLocale = PreferenceManager.getDefaultSharedPreferences(this).getString( |
@@ -891,8 +872,8 @@ public class ChromeApplication extends ContentApplication { |
boolean systemEnabled = Settings.System.getInt( |
getApplicationContext().getContentResolver(), |
Settings.System.TEXT_SHOW_PASSWORD, 1) == 1; |
- if (PrefServiceBridge.getInstance().getPasswordEchoEnabled() == systemEnabled) return; |
- |
- PrefServiceBridge.getInstance().setPasswordEchoEnabled(systemEnabled); |
+// if (PrefServiceBridge.getInstance().getPasswordEchoEnabled() == systemEnabled) return; |
+// |
+// PrefServiceBridge.getInstance().setPasswordEchoEnabled(systemEnabled); |
} |
} |