| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 import android.graphics.Color; | 9 import android.graphics.Color; |
| 10 import android.graphics.drawable.Drawable; | 10 import android.graphics.drawable.Drawable; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 new WebappRegistry.FetchWebappDataStorageCallback() { | 257 new WebappRegistry.FetchWebappDataStorageCallback() { |
| 258 @Override | 258 @Override |
| 259 public void onWebappDataStorageRetrieved(WebappDataStorage s
torage) { | 259 public void onWebappDataStorageRetrieved(WebappDataStorage s
torage) { |
| 260 if (storage == null) return; | 260 if (storage == null) return; |
| 261 | 261 |
| 262 // The information in the WebappDataStorage may have bee
n purged by the | 262 // The information in the WebappDataStorage may have bee
n purged by the |
| 263 // user clearing their history or not launching the web
app recently. | 263 // user clearing their history or not launching the web
app recently. |
| 264 // Restore the data if necessary from the intent. | 264 // Restore the data if necessary from the intent. |
| 265 storage.updateFromShortcutIntent(intent); | 265 storage.updateFromShortcutIntent(intent); |
| 266 | 266 |
| 267 // A recent last used time is the indicator that the web
app is still |
| 268 // present on the home screen, and enables sources such
as notifications to |
| 269 // launch web apps. Thus, we do not update the last used
time when the web |
| 270 // app is not directly launched from the home screen, as
this interferes |
| 271 // with the heuristic. |
| 272 if (mWebappInfo.isLaunchedFromHomescreen()) { |
| 273 storage.updateLastUsedTime(); |
| 274 storage.setLaunched(); |
| 275 } |
| 276 |
| 267 // Retrieve the splash image if it exists. | 277 // Retrieve the splash image if it exists. |
| 268 storage.getSplashScreenImage(new WebappDataStorage.Fetch
Callback<Bitmap>() { | 278 storage.getSplashScreenImage(new WebappDataStorage.Fetch
Callback<Bitmap>() { |
| 269 @Override | 279 @Override |
| 270 public void onDataRetrieved(Bitmap splashImage) { | 280 public void onDataRetrieved(Bitmap splashImage) { |
| 271 initializeSplashScreenWidgets(backgroundColor, s
plashImage); | 281 initializeSplashScreenWidgets(backgroundColor, s
plashImage); |
| 272 } | 282 } |
| 273 }); | 283 }); |
| 274 } | 284 } |
| 275 } | 285 } |
| 276 ); | 286 ); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 return visible; | 594 return visible; |
| 585 } | 595 } |
| 586 | 596 |
| 587 // We're temporarily disable CS on webapp since there are some issues. (http
://crbug.com/471950) | 597 // We're temporarily disable CS on webapp since there are some issues. (http
://crbug.com/471950) |
| 588 // TODO(changwan): re-enable it once the issues are resolved. | 598 // TODO(changwan): re-enable it once the issues are resolved. |
| 589 @Override | 599 @Override |
| 590 protected boolean isContextualSearchAllowed() { | 600 protected boolean isContextualSearchAllowed() { |
| 591 return false; | 601 return false; |
| 592 } | 602 } |
| 593 } | 603 } |
| OLD | NEW |