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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java

Issue 2081153005: [Offline Page] Offline page sharing implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and test update added Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory ; 55 import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory ;
56 import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerat or; 56 import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerat or;
57 import org.chromium.chrome.browser.init.InvalidStartupDialog; 57 import org.chromium.chrome.browser.init.InvalidStartupDialog;
58 import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGe nerator; 58 import org.chromium.chrome.browser.invalidation.UniqueIdInvalidationClientNameGe nerator;
59 import org.chromium.chrome.browser.metrics.UmaUtils; 59 import org.chromium.chrome.browser.metrics.UmaUtils;
60 import org.chromium.chrome.browser.metrics.VariationsSession; 60 import org.chromium.chrome.browser.metrics.VariationsSession;
61 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils; 61 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
62 import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderA ndroid; 62 import org.chromium.chrome.browser.net.qualityprovider.ExternalEstimateProviderA ndroid;
63 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; 63 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
64 import org.chromium.chrome.browser.notifications.NotificationPlatformBridge; 64 import org.chromium.chrome.browser.notifications.NotificationPlatformBridge;
65 import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
65 import org.chromium.chrome.browser.omaha.RequestGenerator; 66 import org.chromium.chrome.browser.omaha.RequestGenerator;
66 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza tions; 67 import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza tions;
67 import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient; 68 import org.chromium.chrome.browser.physicalweb.PhysicalWebBleClient;
68 import org.chromium.chrome.browser.physicalweb.PhysicalWebEnvironment; 69 import org.chromium.chrome.browser.physicalweb.PhysicalWebEnvironment;
69 import org.chromium.chrome.browser.policy.PolicyAuditor; 70 import org.chromium.chrome.browser.policy.PolicyAuditor;
70 import org.chromium.chrome.browser.preferences.LocationSettings; 71 import org.chromium.chrome.browser.preferences.LocationSettings;
71 import org.chromium.chrome.browser.preferences.PrefServiceBridge; 72 import org.chromium.chrome.browser.preferences.PrefServiceBridge;
72 import org.chromium.chrome.browser.preferences.Preferences; 73 import org.chromium.chrome.browser.preferences.Preferences;
73 import org.chromium.chrome.browser.preferences.PreferencesLauncher; 74 import org.chromium.chrome.browser.preferences.PreferencesLauncher;
74 import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences; 75 import org.chromium.chrome.browser.preferences.autofill.AutofillPreferences;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 /** 335 /**
335 * Called after onForegroundSessionEnd() indicating that the activity whose onStop() ended the 336 * Called after onForegroundSessionEnd() indicating that the activity whose onStop() ended the
336 * last foreground session was destroyed. 337 * last foreground session was destroyed.
337 */ 338 */
338 private void onForegroundActivityDestroyed() { 339 private void onForegroundActivityDestroyed() {
339 if (ApplicationStatus.isEveryActivityDestroyed()) { 340 if (ApplicationStatus.isEveryActivityDestroyed()) {
340 // These will all be re-initialized when a new Activity starts / upo n next use. 341 // These will all be re-initialized when a new Activity starts / upo n next use.
341 mBackgroundProcessing.onDestroy(); 342 mBackgroundProcessing.onDestroy();
342 PartnerBrowserCustomizations.destroy(); 343 PartnerBrowserCustomizations.destroy();
343 ShareHelper.clearSharedImages(this); 344 ShareHelper.clearSharedImages(this);
345 OfflinePageUtils.clearSharedOfflineFiles(this);
gone 2016/08/12 01:26:12 This is run every single time an Activity dies (wh
Vivian 2016/08/12 23:07:12 I'm not an expert of this...just followed wherever
344 } 346 }
345 } 347 }
346 348
347 private ApplicationStateListener createApplicationStateListener() { 349 private ApplicationStateListener createApplicationStateListener() {
348 return new ApplicationStateListener() { 350 return new ApplicationStateListener() {
349 @Override 351 @Override
350 public void onApplicationStateChange(int newState) { 352 public void onApplicationStateChange(int newState) {
351 if (newState == ApplicationState.HAS_STOPPED_ACTIVITIES) { 353 if (newState == ApplicationState.HAS_STOPPED_ACTIVITIES) {
352 onForegroundSessionEnd(); 354 onForegroundSessionEnd();
353 } else if (newState == ApplicationState.HAS_DESTROYED_ACTIVITIES ) { 355 } else if (newState == ApplicationState.HAS_DESTROYED_ACTIVITIES ) {
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 * Caches flags that are needed by Activities that launch before the native library is loaded 878 * Caches flags that are needed by Activities that launch before the native library is loaded
877 * and stores them in SharedPreferences. Because this function is called dur ing launch after the 879 * and stores them in SharedPreferences. Because this function is called dur ing launch after the
878 * library has loaded, they won't affect the next launch until Chrome is res tarted. 880 * library has loaded, they won't affect the next launch until Chrome is res tarted.
879 */ 881 */
880 private void cacheNativeFlags() { 882 private void cacheNativeFlags() {
881 if (sIsFinishedCachingNativeFlags) return; 883 if (sIsFinishedCachingNativeFlags) return;
882 FeatureUtilities.cacheNativeFlags(this); 884 FeatureUtilities.cacheNativeFlags(this);
883 sIsFinishedCachingNativeFlags = true; 885 sIsFinishedCachingNativeFlags = true;
884 } 886 }
885 } 887 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698