| Index: chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
|
| diff --git a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
|
| index a68985446365aa46ba9efb12f860f9b0a6333878..473cf4e56742f4c8b6ac8e508fc8617ced97a1f4 100644
|
| --- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
|
| +++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
|
| @@ -51,15 +51,17 @@ bool AppBannerInfoBarDelegateAndroid::Create(
|
| base::WeakPtr<AppBannerManager> weak_manager,
|
| const base::string16& app_title,
|
| std::unique_ptr<ShortcutInfo> shortcut_info,
|
| - std::unique_ptr<SkBitmap> icon,
|
| + std::unique_ptr<SkBitmap> primary_icon,
|
| + std::unique_ptr<SkBitmap> badge_icon,
|
| int event_request_id,
|
| webapk::InstallSource webapk_install_source) {
|
| bool is_webapk = ChromeWebApkHost::CanInstallWebApk();
|
| const GURL url = shortcut_info->url;
|
| auto infobar_delegate =
|
| base::WrapUnique(new banners::AppBannerInfoBarDelegateAndroid(
|
| - weak_manager, app_title, std::move(shortcut_info), std::move(icon),
|
| - event_request_id, is_webapk, webapk_install_source));
|
| + weak_manager, app_title, std::move(shortcut_info),
|
| + std::move(primary_icon), std::move(badge_icon), event_request_id,
|
| + is_webapk, webapk_install_source));
|
| auto* raw_delegate = infobar_delegate.get();
|
| auto infobar = base::MakeUnique<AppBannerInfoBarAndroid>(
|
| std::move(infobar_delegate), url, is_webapk);
|
| @@ -208,14 +210,16 @@ AppBannerInfoBarDelegateAndroid::AppBannerInfoBarDelegateAndroid(
|
| base::WeakPtr<AppBannerManager> weak_manager,
|
| const base::string16& app_title,
|
| std::unique_ptr<ShortcutInfo> shortcut_info,
|
| - std::unique_ptr<SkBitmap> icon,
|
| + std::unique_ptr<SkBitmap> primary_icon,
|
| + std::unique_ptr<SkBitmap> badge_icon,
|
| int event_request_id,
|
| bool is_webapk,
|
| webapk::InstallSource webapk_install_source)
|
| : weak_manager_(weak_manager),
|
| app_title_(app_title),
|
| shortcut_info_(std::move(shortcut_info)),
|
| - icon_(std::move(icon)),
|
| + primary_icon_(std::move(primary_icon)),
|
| + badge_icon_(std::move(badge_icon)),
|
| event_request_id_(event_request_id),
|
| has_user_interaction_(false),
|
| is_webapk_(is_webapk),
|
| @@ -235,7 +239,7 @@ AppBannerInfoBarDelegateAndroid::AppBannerInfoBarDelegateAndroid(
|
| int event_request_id)
|
| : app_title_(app_title),
|
| native_app_data_(native_app_data),
|
| - icon_(std::move(icon)),
|
| + primary_icon_(std::move(icon)),
|
| native_app_package_(native_app_package),
|
| referrer_(referrer),
|
| event_request_id_(event_request_id),
|
| @@ -285,7 +289,7 @@ bool AppBannerInfoBarDelegateAndroid::AcceptWebApp(
|
| web_contents, shortcut_info_->url.spec(), AppBannerSettingsHelper::WEB);
|
|
|
| ShortcutHelper::AddToLauncherWithSkBitmap(web_contents, *shortcut_info_,
|
| - *icon_.get());
|
| + *primary_icon_.get());
|
|
|
| SendBannerAccepted();
|
| return true;
|
| @@ -337,7 +341,9 @@ bool AppBannerInfoBarDelegateAndroid::AcceptWebApk(
|
| base::Bind(&AppBannerInfoBarDelegateAndroid::OnWebApkInstallFinished,
|
| weak_ptr_factory_.GetWeakPtr());
|
| ShortcutHelper::InstallWebApkWithSkBitmap(web_contents, *shortcut_info_,
|
| - *icon_.get(), callback);
|
| + *primary_icon_.get(),
|
| + *badge_icon_.get(), callback);
|
| +
|
| SendBannerAccepted();
|
|
|
| // Prevent the infobar from disappearing, because the infobar will show
|
| @@ -389,7 +395,7 @@ void AppBannerInfoBarDelegateAndroid::OnWebApkInstallFailed(
|
| InfoBarService::WebContentsFromInfoBar(infobar());
|
| // Add webapp shortcut to the homescreen.
|
| ShortcutHelper::AddToLauncherWithSkBitmap(web_contents, *shortcut_info_,
|
| - *icon_.get());
|
| + *primary_icon_.get());
|
| }
|
|
|
| infobar()->RemoveSelf();
|
| @@ -414,7 +420,7 @@ AppBannerInfoBarDelegateAndroid::GetIdentifier() const {
|
| }
|
|
|
| gfx::Image AppBannerInfoBarDelegateAndroid::GetIcon() const {
|
| - return gfx::Image::CreateFrom1xBitmap(*icon_.get());
|
| + return gfx::Image::CreateFrom1xBitmap(*primary_icon_.get());
|
| }
|
|
|
| void AppBannerInfoBarDelegateAndroid::InfoBarDismissed() {
|
|
|