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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_manager.cc

Issue 2676863002: Update WebApkInstaller to support badge icon in installation. (Closed)
Patch Set: addressing comments 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/webapps/add_to_homescreen_manager.cc
diff --git a/chrome/browser/android/webapps/add_to_homescreen_manager.cc b/chrome/browser/android/webapps/add_to_homescreen_manager.cc
index c892d5c9afa4369403231bae137e6b3c57584bac..65ab2632057de7f340d6a500f8e3eff6e8bd0b74 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_manager.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_manager.cc
@@ -163,14 +163,13 @@ void AddToHomescreenManager::OnDataAvailable(const ShortcutInfo& info,
const SkBitmap& primary_icon,
const SkBitmap& badge_icon) {
if (is_webapk_compatible_) {
- // TODO(zpeng): Add badge to WebAPK installation flow.
WebApkInstallService* install_service =
WebApkInstallService::Get(
data_fetcher_->web_contents()->GetBrowserContext());
if (install_service->IsInstallInProgress(info.manifest_url))
ShortcutHelper::ShowWebApkInstallInProgressToast();
else
- CreateInfoBarForWebApk(info, primary_icon);
+ CreateInfoBarForWebApk(info, primary_icon, badge_icon);
JNIEnv* env = base::android::AttachCurrentThread();
Java_AddToHomescreenManager_onFinished(env, java_ref_);
@@ -188,11 +187,13 @@ void AddToHomescreenManager::OnDataAvailable(const ShortcutInfo& info,
AddShortcut(info, primary_icon);
}
-void AddToHomescreenManager::CreateInfoBarForWebApk(const ShortcutInfo& info,
- const SkBitmap& icon) {
+void AddToHomescreenManager::CreateInfoBarForWebApk(
+ const ShortcutInfo& info,
+ const SkBitmap& primary_icon,
+ const SkBitmap& badge_icon) {
banners::AppBannerInfoBarDelegateAndroid::Create(
data_fetcher_->web_contents(), nullptr, info.user_title,
- base::MakeUnique<ShortcutInfo>(info), base::MakeUnique<SkBitmap>(icon),
+ base::MakeUnique<ShortcutInfo>(info), primary_icon, badge_icon,
-1 /* event_request_id */, webapk::INSTALL_SOURCE_MENU);
}
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_manager.h ('k') | chrome/browser/banners/app_banner_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698