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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 "Tab.TotalTabCount.BeforeLeavingApp", totalTabCount); | 327 "Tab.TotalTabCount.BeforeLeavingApp", totalTabCount); |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 /** | 331 /** |
332 * Called after onForegroundSessionEnd() indicating that the activity whose onStop() ended the | 332 * Called after onForegroundSessionEnd() indicating that the activity whose onStop() ended the |
333 * last foreground session was destroyed. | 333 * last foreground session was destroyed. |
334 */ | 334 */ |
335 private void onForegroundActivityDestroyed() { | 335 private void onForegroundActivityDestroyed() { |
336 if (ApplicationStatus.isEveryActivityDestroyed()) { | 336 if (ApplicationStatus.isEveryActivityDestroyed()) { |
337 // These will all be re-initialized when a new Activity starts / upo n next use. | |
337 mBackgroundProcessing.onDestroy(); | 338 mBackgroundProcessing.onDestroy(); |
338 if (mDevToolsServer != null) { | |
gone
2016/07/28 16:09:57
Why'd these lines get taken out?
agrieve
2016/07/28 16:39:27
I mentioned it in the bug, but have now updated th
| |
339 mDevToolsServer.destroy(); | |
340 mDevToolsServer = null; | |
341 } | |
342 stopApplicationActivityTracker(); | |
343 PartnerBrowserCustomizations.destroy(); | 339 PartnerBrowserCustomizations.destroy(); |
344 ShareHelper.clearSharedImages(this); | 340 ShareHelper.clearSharedImages(this); |
345 CombinedPolicyProvider.get().destroy(); | |
346 } | 341 } |
347 } | 342 } |
348 | 343 |
349 private ApplicationStateListener createApplicationStateListener() { | 344 private ApplicationStateListener createApplicationStateListener() { |
350 return new ApplicationStateListener() { | 345 return new ApplicationStateListener() { |
351 @Override | 346 @Override |
352 public void onApplicationStateChange(int newState) { | 347 public void onApplicationStateChange(int newState) { |
353 if (newState == ApplicationState.HAS_STOPPED_ACTIVITIES) { | 348 if (newState == ApplicationState.HAS_STOPPED_ACTIVITIES) { |
354 onForegroundSessionEnd(); | 349 onForegroundSessionEnd(); |
355 } else if (newState == ApplicationState.HAS_DESTROYED_ACTIVITIES ) { | 350 } else if (newState == ApplicationState.HAS_DESTROYED_ACTIVITIES ) { |
(...skipping 506 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 | 857 * 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 | 858 * 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. | 859 * library has loaded, they won't affect the next launch until Chrome is res tarted. |
865 */ | 860 */ |
866 private void cacheNativeFlags() { | 861 private void cacheNativeFlags() { |
867 if (sIsFinishedCachingNativeFlags) return; | 862 if (sIsFinishedCachingNativeFlags) return; |
868 FeatureUtilities.cacheNativeFlags(this); | 863 FeatureUtilities.cacheNativeFlags(this); |
869 sIsFinishedCachingNativeFlags = true; | 864 sIsFinishedCachingNativeFlags = true; |
870 } | 865 } |
871 } | 866 } |
OLD | NEW |