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

Unified Diff: chrome/browser/android/banners/app_banner_infobar_delegate_android.cc

Issue 2808263004: Add a new WebAPK-specific app banner shortcut source. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_info.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c0b69b8270aa85d7f07b074489deaec14d67ba4f..053b497382bfe36485907f471b5609afb15df042 100644
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
@@ -227,6 +227,11 @@ AppBannerInfoBarDelegateAndroid::AppBannerInfoBarDelegateAndroid(
webapk_install_source_(webapk_install_source),
weak_ptr_factory_(this) {
DCHECK(!IsInfoEmpty(shortcut_info_));
+
+ // Explicitly update the source to separate WebAPKs installed from the banner
+ // from legacy PWAs that are installed from the banner.
+ if (is_webapk && webapk_install_source == webapk::INSTALL_SOURCE_BANNER)
+ shortcut_info_->UpdateSource(ShortcutInfo::SOURCE_APP_BANNER_WEBAPK);
pkotwicz 2017/04/12 15:46:01 I would rather if this code was in AppBannerManage
dominickn 2017/05/03 00:26:04 I'd rather keep WebAPK specific code in here. Soon
Xi Han 2017/05/03 18:07:50 AppBannerManagerAndroid has the |can_install_webap
dominickn 2017/05/04 00:33:59 Hmm, that's true. I forgot about that member entir
CreateJavaDelegate();
}
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_info.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698