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

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

Issue 2827373002: Merge 59 [Android WebAPK] Fix regression by https://codereview.chromium.org/2725813004/ (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.content.Intent; 7 import android.content.Intent;
8 import android.os.Bundle; 8 import android.os.Bundle;
9 9
10 import org.chromium.base.ContextUtils; 10 import org.chromium.base.ContextUtils;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // renderer processes by declaring the Chrome's renderer service in its AndroidManifest.xml 117 // renderer processes by declaring the Chrome's renderer service in its AndroidManifest.xml
118 // and sets {@link ChildProcessCreationParams} for WebAPK's renderer pro cess so the 118 // and sets {@link ChildProcessCreationParams} for WebAPK's renderer pro cess so the
119 // {@link ChildProcessLauncher} knows which application's renderer servi ce to connect to. 119 // {@link ChildProcessLauncher} knows which application's renderer servi ce to connect to.
120 initializeChildProcessCreationParams(mCanLaunchRendererInWebApkProcess); 120 initializeChildProcessCreationParams(mCanLaunchRendererInWebApkProcess);
121 } 121 }
122 122
123 @Override 123 @Override
124 protected void onDeferredStartupWithStorage(WebappDataStorage storage) { 124 protected void onDeferredStartupWithStorage(WebappDataStorage storage) {
125 super.onDeferredStartupWithStorage(storage); 125 super.onDeferredStartupWithStorage(storage);
126 126
127 // Initialize the time of the last is-update-needed check with the regis tration time. This
128 // prevents checking for updates on the first run.
129 storage.updateTimeOfLastCheckForUpdatedWebManifest();
130
131 mUpdateManager = new WebApkUpdateManager(WebApkActivity.this, storage); 127 mUpdateManager = new WebApkUpdateManager(WebApkActivity.this, storage);
132 mUpdateManager.updateIfNeeded(getActivityTab(), 128 mUpdateManager.updateIfNeeded(getActivityTab(),
133 (WebApkInfo) mWebappInfo); 129 (WebApkInfo) mWebappInfo);
134 } 130 }
135 131
136 @Override 132 @Override
137 protected void onDeferredStartupWithNullStorage() { 133 protected void onDeferredStartupWithNullStorage() {
138 super.onDeferredStartupWithNullStorage(); 134 super.onDeferredStartupWithNullStorage();
139 135
140 // Register the WebAPK. The WebAPK is not registered when it is created so it has to be 136 // Register the WebAPK. The WebAPK is not registered when it is created so it has to be
141 // registered now. The WebAPK may also become unregistered after a user clears Chrome's 137 // registered now. The WebAPK may also become unregistered after a user clears Chrome's
142 // data. 138 // data.
143 WebappRegistry.getInstance().register( 139 WebappRegistry.getInstance().register(
144 mWebappInfo.id(), new WebappRegistry.FetchWebappDataStorageCallb ack() { 140 mWebappInfo.id(), new WebappRegistry.FetchWebappDataStorageCallb ack() {
145 @Override 141 @Override
146 public void onWebappDataStorageRetrieved(WebappDataStorage s torage) { 142 public void onWebappDataStorageRetrieved(WebappDataStorage s torage) {
143 // Initialize the time of the last is-update-needed chec k with the
144 // registration time. This prevents checking for updates on the first run.
145 storage.updateTimeOfLastCheckForUpdatedWebManifest();
146
147 onDeferredStartupWithStorage(storage); 147 onDeferredStartupWithStorage(storage);
148 } 148 }
149 }); 149 });
150 } 150 }
151 151
152 @Override 152 @Override
153 public void onPause() { 153 public void onPause() {
154 super.onPause(); 154 super.onPause();
155 initializeChildProcessCreationParams(false); 155 initializeChildProcessCreationParams(false);
156 } 156 }
(...skipping 17 matching lines...) Expand all
174 } 174 }
175 175
176 @Override 176 @Override
177 protected void onDestroyInternal() { 177 protected void onDestroyInternal() {
178 if (mUpdateManager != null) { 178 if (mUpdateManager != null) {
179 mUpdateManager.destroy(); 179 mUpdateManager.destroy();
180 } 180 }
181 super.onDestroyInternal(); 181 super.onDestroyInternal();
182 } 182 }
183 } 183 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698