| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 const std::string& webapp_id); | 95 const std::string& webapp_id); |
| 96 | 96 |
| 97 // Stores the webapp splash screen in the WebappDataStorage associated with | 97 // Stores the webapp splash screen in the WebappDataStorage associated with |
| 98 // |webapp_id|. | 98 // |webapp_id|. |
| 99 static void StoreWebappSplashImage(const std::string& webapp_id, | 99 static void StoreWebappSplashImage(const std::string& webapp_id, |
| 100 const SkBitmap& splash_image); | 100 const SkBitmap& splash_image); |
| 101 | 101 |
| 102 // Returns the given icon, modified to match the launcher requirements. | 102 // Returns the given icon, modified to match the launcher requirements. |
| 103 // This method may generate an entirely new icon; if this is the case, | 103 // This method may generate an entirely new icon; if this is the case, |
| 104 // |is_generated| will be set to |true|. | 104 // |is_generated| will be set to |true|. |
| 105 static SkBitmap FinalizeLauncherIcon(const SkBitmap& icon, | 105 // Must be called on a background worker thread. |
| 106 const GURL& url, | 106 static SkBitmap FinalizeLauncherIconInBackground(const SkBitmap& icon, |
| 107 bool* is_generated); | 107 const GURL& url, |
| 108 bool* is_generated); |
| 108 | 109 |
| 109 // Returns true if WebAPKs are enabled and there is a WebAPK installed which | 110 // Returns true if WebAPKs are enabled and there is a WebAPK installed which |
| 110 // can handle |url|. | 111 // can handle |url|. |
| 111 static bool IsWebApkInstalled(const GURL& url); | 112 static bool IsWebApkInstalled(const GURL& url); |
| 112 | 113 |
| 113 // Generates a scope URL based on the passed in |url|. It should be used | 114 // Generates a scope URL based on the passed in |url|. It should be used |
| 114 // when the Web Manifest does not specify a scope URL. | 115 // when the Web Manifest does not specify a scope URL. |
| 115 static GURL GetScopeFromURL(const GURL& url); | 116 static GURL GetScopeFromURL(const GURL& url); |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 ShortcutHelper() = delete; | 119 ShortcutHelper() = delete; |
| 119 ~ShortcutHelper() = delete; | 120 ~ShortcutHelper() = delete; |
| 120 | 121 |
| 121 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 122 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 125 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
| OLD | NEW |