| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.Intent; | 9 import android.content.Intent; |
| 10 import android.content.SharedPreferences; | 10 import android.content.SharedPreferences; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory
; | 53 import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory
; |
| 54 import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerat
or; | 54 import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerat
or; |
| 55 import org.chromium.chrome.browser.init.InvalidStartupDialog; | 55 import org.chromium.chrome.browser.init.InvalidStartupDialog; |
| 56 import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGe
nerator; | 56 import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGe
nerator; |
| 57 import org.chromium.chrome.browser.metrics.UmaUtils; | 57 import org.chromium.chrome.browser.metrics.UmaUtils; |
| 58 import org.chromium.chrome.browser.metrics.VariationsSession; | 58 import org.chromium.chrome.browser.metrics.VariationsSession; |
| 59 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; | 59 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; |
| 60 import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderA
ndroid; | 60 import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderA
ndroid; |
| 61 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; | 61 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
| 62 import org.chromium.chrome.browser.notifications.NotificationPlatformBridge; | 62 import org.chromium.chrome.browser.notifications.NotificationPlatformBridge; |
| 63 import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; |
| 63 import org.chromium.chrome.browser.omaha.RequestGenerator; | 64 import org.chromium.chrome.browser.omaha.RequestGenerator; |
| 64 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza
tions; | 65 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza
tions; |
| 65 import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; | 66 import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; |
| 66 import org.chromium.chrome.browser.physicalweb.PhysicalWebEnvironment; | 67 import org.chromium.chrome.browser.physicalweb.PhysicalWebEnvironment; |
| 67 import org.chromium.chrome.browser.policy.PolicyAuditor; | 68 import org.chromium.chrome.browser.policy.PolicyAuditor; |
| 68 import org.chromium.chrome.browser.preferences.LocationSettings; | 69 import org.chromium.chrome.browser.preferences.LocationSettings; |
| 69 import org.chromium.chrome.browser.preferences.PrefServiceBridge; | 70 import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
| 70 import org.chromium.chrome.browser.preferences.Preferences; | 71 import org.chromium.chrome.browser.preferences.Preferences; |
| 71 import org.chromium.chrome.browser.preferences.PreferencesLauncher; | 72 import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
| 72 import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; | 73 import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 private void onForegroundActivityDestroyed() { | 336 private void onForegroundActivityDestroyed() { |
| 336 if (ApplicationStatus.isEveryActivityDestroyed()) { | 337 if (ApplicationStatus.isEveryActivityDestroyed()) { |
| 337 mBackgroundProcessing.onDestroy(); | 338 mBackgroundProcessing.onDestroy(); |
| 338 if (mDevToolsServer != null) { | 339 if (mDevToolsServer != null) { |
| 339 mDevToolsServer.destroy(); | 340 mDevToolsServer.destroy(); |
| 340 mDevToolsServer = null; | 341 mDevToolsServer = null; |
| 341 } | 342 } |
| 342 stopApplicationActivityTracker(); | 343 stopApplicationActivityTracker(); |
| 343 PartnerBrowserCustomizations.destroy(); | 344 PartnerBrowserCustomizations.destroy(); |
| 344 ShareHelper.clearSharedImages(this); | 345 ShareHelper.clearSharedImages(this); |
| 346 OfflinePageUtils.clearSharedOfflineFiles(this); |
| 345 CombinedPolicyProvider.get().destroy(); | 347 CombinedPolicyProvider.get().destroy(); |
| 346 } | 348 } |
| 347 } | 349 } |
| 348 | 350 |
| 349 private ApplicationStateListener createApplicationStateListener() { | 351 private ApplicationStateListener createApplicationStateListener() { |
| 350 return new ApplicationStateListener() { | 352 return new ApplicationStateListener() { |
| 351 @Override | 353 @Override |
| 352 public void onApplicationStateChange(int newState) { | 354 public void onApplicationStateChange(int newState) { |
| 353 if (newState == ApplicationState.HAS_STOPPED_ACTIVITIES) { | 355 if (newState == ApplicationState.HAS_STOPPED_ACTIVITIES) { |
| 354 onForegroundSessionEnd(); | 356 onForegroundSessionEnd(); |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 * Caches flags that are needed by Activities that launch before the native
library is loaded | 864 * Caches flags that are needed by Activities that launch before the native
library is loaded |
| 863 * and stores them in SharedPreferences. Because this function is called dur
ing launch after the | 865 * and stores them in SharedPreferences. Because this function is called dur
ing launch after the |
| 864 * library has loaded, they won't affect the next launch until Chrome is res
tarted. | 866 * library has loaded, they won't affect the next launch until Chrome is res
tarted. |
| 865 */ | 867 */ |
| 866 private void cacheNativeFlags() { | 868 private void cacheNativeFlags() { |
| 867 if (sIsFinishedCachingNativeFlags) return; | 869 if (sIsFinishedCachingNativeFlags) return; |
| 868 FeatureUtilities.cacheNativeFlags(this); | 870 FeatureUtilities.cacheNativeFlags(this); |
| 869 sIsFinishedCachingNativeFlags = true; | 871 sIsFinishedCachingNativeFlags = true; |
| 870 } | 872 } |
| 871 } | 873 } |
| OLD | NEW |