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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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 | 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 | 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 | 270 // app is not directly launched from the home screen, as
this interferes |
271 // with the heuristic. | 271 // with the heuristic. |
272 if (mWebappInfo.isLaunchedFromHomescreen()) { | 272 if (mWebappInfo.isLaunchedFromHomescreen()) { |
273 storage.updateLastUsedTime(); | 273 storage.updateLastUsedTime(); |
274 storage.setLaunched(); | |
275 } | 274 } |
276 | 275 |
277 // Retrieve the splash image if it exists. | 276 // Retrieve the splash image if it exists. |
278 storage.getSplashScreenImage(new WebappDataStorage.Fetch
Callback<Bitmap>() { | 277 storage.getSplashScreenImage(new WebappDataStorage.Fetch
Callback<Bitmap>() { |
279 @Override | 278 @Override |
280 public void onDataRetrieved(Bitmap splashImage) { | 279 public void onDataRetrieved(Bitmap splashImage) { |
281 initializeSplashScreenWidgets(backgroundColor, s
plashImage); | 280 initializeSplashScreenWidgets(backgroundColor, s
plashImage); |
282 } | 281 } |
283 }); | 282 }); |
284 } | 283 } |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 return visible; | 593 return visible; |
595 } | 594 } |
596 | 595 |
597 // We're temporarily disable CS on webapp since there are some issues. (http
://crbug.com/471950) | 596 // We're temporarily disable CS on webapp since there are some issues. (http
://crbug.com/471950) |
598 // TODO(changwan): re-enable it once the issues are resolved. | 597 // TODO(changwan): re-enable it once the issues are resolved. |
599 @Override | 598 @Override |
600 protected boolean isContextualSearchAllowed() { | 599 protected boolean isContextualSearchAllowed() { |
601 return false; | 600 return false; |
602 } | 601 } |
603 } | 602 } |
OLD | NEW |