| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |