Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: chrome/browser/android/webapk/webapk_installer.h

Issue 2676863002: Update WebApkInstaller to support badge icon in installation. (Closed)
Patch Set: Addressing comments: modifying tests, etc. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..eda7741ea3336d62687358128c46c9bf0b51a65a 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,15 @@ 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 was an attempt to fetch
+ // badge icon.
+ void OnGotBadgeIconMurmur2Hash(bool did_fetch_badge_icon,
+ const std::string& primary_icon_hash,
+ 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 +242,11 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// Web Manifest info.
const ShortcutInfo shortcut_info_;
- // WebAPK app icon.
- const SkBitmap shortcut_icon_;
+ // WebAPK primary icon.
+ const SkBitmap primary_icon_;
+
+ // WebAPK badge icon.
+ const SkBitmap badge_icon_;
// WebAPK server URL.
GURL server_url_;

Powered by Google App Engine
This is Rietveld 408576698