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

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

Issue 2638213002: Ensure WebAPK installation always records the app banner installation event. (Closed)
Patch Set: Don't pollute banner statistics Created 3 years, 11 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 | no next file » | no next file with comments »
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 b9ccb59699fc5c3e8a89f18c1842c1dc349d5327..8ed416a796caedb807fa666b130c2714a1d4a298 100644
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
@@ -335,6 +335,17 @@ bool AppBannerInfoBarDelegateAndroid::AcceptWebApk(
TrackUserResponse(USER_RESPONSE_WEB_APP_ACCEPTED);
AppBannerSettingsHelper::RecordBannerInstallEvent(
web_contents, shortcut_info_->url.spec(), AppBannerSettingsHelper::WEB);
+ } else if (is_webapk_) {
+ // This branch will be entered if we are a WebAPK that was triggered from
+ // the add to homescreen menu item. Manually record the app banner added to
+ // homescreen event in this case. Don't call
+ // AppBannerSettingsHelper::RecordBannerInstallEvent as that records
+ // banner-specific metrics in addition to this event.
+ AppBannerSettingsHelper::RecordBannerEvent(
+ web_contents, web_contents->GetLastCommittedURL(),
+ shortcut_info_->url.spec(),
+ AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN,
+ AppBannerManager::GetCurrentTime());
}
Java_AppBannerInfoBarDelegateAndroid_setWebApkInstallingState(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698