OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_WEBAPK_WEBAPK_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Creates a self-owned WebApkInstaller instance and talks to the Chrome | 44 // Creates a self-owned WebApkInstaller instance and talks to the Chrome |
45 // WebAPK server to generate a WebAPK on the server and locally requests the | 45 // WebAPK server to generate a WebAPK on the server and locally requests the |
46 // APK to be installed. Calls |callback| once the install completed or failed. | 46 // APK to be installed. Calls |callback| once the install completed or failed. |
47 static void InstallAsync(content::BrowserContext* context, | 47 static void InstallAsync(content::BrowserContext* context, |
48 const ShortcutInfo& shortcut_info, | 48 const ShortcutInfo& shortcut_info, |
49 const SkBitmap& primary_icon, | 49 const SkBitmap& primary_icon, |
50 const SkBitmap& badge_icon, | 50 const SkBitmap& badge_icon, |
51 const FinishCallback& finish_callback); | 51 const FinishCallback& finish_callback); |
52 | 52 |
53 // TODO(zpeng): Add badge icon to WebAPK update route. | |
54 // Creates a self-owned WebApkInstaller instance and talks to the Chrome | 53 // Creates a self-owned WebApkInstaller instance and talks to the Chrome |
55 // WebAPK server to update a WebAPK on the server and locally requests the | 54 // WebAPK server to update a WebAPK on the server and locally requests the |
56 // APK to be installed. Calls |callback| once the install completed or failed. | 55 // APK to be installed. Calls |callback| once the install completed or failed. |
57 static void UpdateAsync( | 56 static void UpdateAsync( |
58 content::BrowserContext* context, | 57 content::BrowserContext* context, |
59 const ShortcutInfo& shortcut_info, | 58 const ShortcutInfo& shortcut_info, |
60 const SkBitmap& primary_icon, | 59 const SkBitmap& primary_icon, |
| 60 const SkBitmap& badge_icon, |
61 const std::string& webapk_package, | 61 const std::string& webapk_package, |
62 int webapk_version, | 62 int webapk_version, |
63 const std::map<std::string, std::string>& icon_url_to_murmur2_hash, | 63 const std::map<std::string, std::string>& icon_url_to_murmur2_hash, |
64 bool is_manifest_stale, | 64 bool is_manifest_stale, |
65 const FinishCallback& callback); | 65 const FinishCallback& callback); |
66 | 66 |
67 // Calls the private function |InstallAsync| for testing. | 67 // Calls the private function |InstallAsync| for testing. |
68 // Should be used only for testing. | 68 // Should be used only for testing. |
69 static void InstallAsyncForTesting(WebApkInstaller* installer, | 69 static void InstallAsyncForTesting(WebApkInstaller* installer, |
70 const FinishCallback& finish_callback); | 70 const FinishCallback& finish_callback); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // Points to the Java Object. | 210 // Points to the Java Object. |
211 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 211 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
212 | 212 |
213 // Used to get |weak_ptr_|. | 213 // Used to get |weak_ptr_|. |
214 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 214 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
215 | 215 |
216 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 216 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
217 }; | 217 }; |
218 | 218 |
219 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 219 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
OLD | NEW |