Chromium Code Reviews| 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 // Update the last used time only when the web app has b een directly | |
| 268 // launched from home screen. | |
|
gone
2016/04/07 19:10:44
nit: Maybe comment here about why? Not wanting to
dominickn
2016/04/08 01:10:45
Done.
| |
| 269 if (mWebappInfo.launchedFromHomescreen()) { | |
| 270 storage.updateLastUsedTime(); | |
| 271 storage.setLaunched(); | |
| 272 } | |
| 273 | |
| 267 // Retrieve the splash image if it exists. | 274 // Retrieve the splash image if it exists. |
| 268 storage.getSplashScreenImage(new WebappDataStorage.Fetch Callback<Bitmap>() { | 275 storage.getSplashScreenImage(new WebappDataStorage.Fetch Callback<Bitmap>() { |
| 269 @Override | 276 @Override |
| 270 public void onDataRetrieved(Bitmap splashImage) { | 277 public void onDataRetrieved(Bitmap splashImage) { |
| 271 initializeSplashScreenWidgets(backgroundColor, s plashImage); | 278 initializeSplashScreenWidgets(backgroundColor, s plashImage); |
| 272 } | 279 } |
| 273 }); | 280 }); |
| 274 } | 281 } |
| 275 } | 282 } |
| 276 ); | 283 ); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 return visible; | 591 return visible; |
| 585 } | 592 } |
| 586 | 593 |
| 587 // We're temporarily disable CS on webapp since there are some issues. (http ://crbug.com/471950) | 594 // 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. | 595 // TODO(changwan): re-enable it once the issues are resolved. |
| 589 @Override | 596 @Override |
| 590 protected boolean isContextualSearchAllowed() { | 597 protected boolean isContextualSearchAllowed() { |
| 591 return false; | 598 return false; |
| 592 } | 599 } |
| 593 } | 600 } |
| OLD | NEW |