Chromium Code Reviews| Index: chrome/browser/android/webapk/webapk_installer.h |
| diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h |
| index b58d7e1173d5ccb6bad2e319b69d541ee55d3c5b..b6e60590c083ad6b9221a7ad673ced9781fc2da5 100644 |
| --- a/chrome/browser/android/webapk/webapk_installer.h |
| +++ b/chrome/browser/android/webapk/webapk_installer.h |
| @@ -49,9 +49,11 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| // or failed. |
| static void InstallAsync(content::BrowserContext* context, |
| const ShortcutInfo& shortcut_info, |
| - const SkBitmap& shortcut_icon, |
| + const SkBitmap& primary_icon, |
| + const SkBitmap& badge_icon, |
| const FinishCallback& finish_callback); |
| + // TODO(zpeng): Add badge icon to WebAPK update route. |
| // Creates a self-owned WebApkInstaller instance and talks to the Chrome |
| // WebAPK server to update a WebAPK on the server and to the Google Play |
| // server to install the downloaded WebAPK. Calls |callback| after the request |
| @@ -59,7 +61,7 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| static void UpdateAsync( |
| content::BrowserContext* context, |
| const ShortcutInfo& shortcut_info, |
| - const SkBitmap& shortcut_icon, |
| + const SkBitmap& primary_icon, |
| const std::string& webapk_package, |
| int webapk_version, |
| const std::map<std::string, std::string>& icon_url_to_murmur2_hash, |
| @@ -102,7 +104,8 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| protected: |
| WebApkInstaller(content::BrowserContext* browser_context, |
| const ShortcutInfo& shortcut_info, |
| - const SkBitmap& shortcut_icon); |
| + const SkBitmap& primary_icon, |
| + const SkBitmap& badge_icon); |
| // Starts installion of the downloaded WebAPK. |
| // |file_path| is the file path that the WebAPK was downloaded to. |
| @@ -159,8 +162,14 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| // net::URLFetcherDelegate: |
| void OnURLFetchComplete(const net::URLFetcher* source) override; |
| - // Called with the computed Murmur2 hash for the app icon. |
| - void OnGotIconMurmur2Hash(const std::string& icon_murmur2_hash); |
| + // Called with the computed Murmur2 hash for the primary icon. |
| + void OnGotPrimaryIconMurmur2Hash(const std::string& primary_icon_hash); |
| + |
| + // Called with the computed Murmur2 hash for the badge icon, and |
| + // |did_fetch_badge_icon| to indicate whether there is an attempt to fetch |
| + // badge icon. |
| + void OnGotBadgeIconMurmur2Hash(bool did_fetch_badge_icon, |
| + const std::string& badge_icon_hash); |
| // Sends request to WebAPK server to create WebAPK. During a successful |
| // request the WebAPK server responds with the URL of the generated WebAPK. |
| @@ -232,8 +241,13 @@ class WebApkInstaller : public net::URLFetcherDelegate { |
| // Web Manifest info. |
| const ShortcutInfo shortcut_info_; |
| - // WebAPK app icon. |
| - const SkBitmap shortcut_icon_; |
| + // WebAPK primary icon & its Murmur2 hash. |
| + const SkBitmap primary_icon_; |
| + std::string primary_icon_hash_; |
|
dominickn
2017/04/04 05:25:33
Instead of having primary_icon_hash_ and badge_ico
F
2017/04/04 15:21:26
Done.
|
| + |
| + // WebAPK badge icon & its Murmur2 hash. |
| + const SkBitmap badge_icon_; |
| + std::string badge_icon_hash_; |
| // WebAPK server URL. |
| GURL server_url_; |