| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| index b369549608351605ca3200f4d26a2d3d29b87473..55864a364bbbb7b66a1c99661c34db2815ecb22c 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
|
| @@ -27,6 +27,11 @@ import org.chromium.webapk.lib.client.WebApkServiceConnectionManager;
|
| * UI-less Chrome.
|
| */
|
| public class WebApkActivity extends WebappActivity {
|
| + private static final String TAG = "cr_WebApkActivity";
|
| +
|
| + /** Detects whether the associated Web Manifest changes. */
|
| + private ManifestUpgradeDetector mManifestUpgradeDetector = null;
|
| +
|
| @Override
|
| protected void onNewIntent(Intent intent) {
|
| super.onNewIntent(intent);
|
| @@ -58,12 +63,11 @@ public class WebApkActivity extends WebappActivity {
|
| @Override
|
| public void onWebappDataStorageRetrieved(
|
| WebappDataStorage storage) {
|
| - storage.updateFromShortcutIntent(getIntent());
|
| + storage.updateFromShortcutIntent(getIntent(), true);
|
| }
|
| });
|
| return;
|
| }
|
| -
|
| // Update WebappInfo from WebappDataStorage because the information in WebappDataStorage
|
| // is more up to date than the information in the launch intent. Whenever the Web Manifest
|
| // changes, WebappDataStorage is updated. Depending on which of the Web Manifest's fields
|
| @@ -143,6 +147,16 @@ public class WebApkActivity extends WebappActivity {
|
| }
|
|
|
| @Override
|
| + protected void checkUpdates() {
|
| + // TODO(hanxi): Asks WebApk's update manager whether to check resources updates.
|
| + if (mManifestUpgradeDetector == null) {
|
| + mManifestUpgradeDetector =
|
| + new ManifestUpgradeDetector(getActivityTab(), mWebappInfo);
|
| + }
|
| + mManifestUpgradeDetector.start();
|
| + }
|
| +
|
| + @Override
|
| public void onPause() {
|
| super.onPause();
|
| initializeChildProcessCreationParams(false);
|
| @@ -164,4 +178,12 @@ public class WebApkActivity extends WebappActivity {
|
| }
|
| ChildProcessCreationParams.set(params);
|
| }
|
| +
|
| + @Override
|
| + protected void onDestroyInternal() {
|
| + if (mManifestUpgradeDetector != null) {
|
| + mManifestUpgradeDetector.destroy();
|
| + }
|
| + super.onDestroyInternal();
|
| + }
|
| }
|
|
|