Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 const SkBitmap& splash_image); | 89 const SkBitmap& splash_image); |
| 90 | 90 |
| 91 // Returns the given icon, modified to match the launcher requirements. | 91 // Returns the given icon, modified to match the launcher requirements. |
| 92 // This method may generate an entirely new icon; if this is the case, | 92 // This method may generate an entirely new icon; if this is the case, |
| 93 // |is_generated| will be set to |true|. | 93 // |is_generated| will be set to |true|. |
| 94 // Must be called on a background worker thread. | 94 // Must be called on a background worker thread. |
| 95 static SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon, | 95 static SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon, |
| 96 const GURL& url, | 96 const GURL& url, |
| 97 bool* is_generated); | 97 bool* is_generated); |
| 98 | 98 |
| 99 // Returns true if WebAPKs are enabled and there is a WebAPK installed which | 99 // Returns the package name of the WebAPK if WebAPKS are enabled and there is |
|
pkotwicz
2016/09/29 14:18:54
Nit: WebAPKS -> WebAPKs
F
2016/09/30 18:02:02
Done.
| |
| 100 // an installed WebAPK which can handle |url|. Returns empty string otherwise. | |
| 101 static std::string QueryWebApkPackage(const GURL& url); | |
| 102 | |
| 103 // Returns true if WebAPKs are enabled and there is an installed WebAPK which | |
| 100 // can handle |url|. | 104 // can handle |url|. |
| 101 static bool IsWebApkInstalled(const GURL& url); | 105 static bool IsWebApkInstalled(const GURL& url); |
| 102 | 106 |
| 103 // Generates a scope URL based on the passed in |url|. It should be used | 107 // Generates a scope URL based on the passed in |url|. It should be used |
| 104 // when the Web Manifest does not specify a scope URL. | 108 // when the Web Manifest does not specify a scope URL. |
| 105 static GURL GetScopeFromURL(const GURL& url); | 109 static GURL GetScopeFromURL(const GURL& url); |
| 106 | 110 |
| 107 private: | 111 private: |
| 108 ShortcutHelper() = delete; | 112 ShortcutHelper() = delete; |
| 109 ~ShortcutHelper() = delete; | 113 ~ShortcutHelper() = delete; |
| 110 | 114 |
| 111 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 115 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
| 112 }; | 116 }; |
| 113 | 117 |
| 114 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 118 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
| OLD | NEW |