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

Unified Diff: chrome/browser/banners/app_banner_data_fetcher.cc

Issue 2122783002: Add metrics for app banner preventDefault() and prompt(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/banners/app_banner_metrics.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/banners/app_banner_data_fetcher.cc
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc
index 48589c0116663d3e26774bee7ecd8002a1145b9f..a9c2bb19b84b18b628eddb0cbdcf4a4d5f0ef622 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -188,6 +188,7 @@ void AppBannerDataFetcher::OnBannerPromptReply(
// Stash the referrer for the case where the banner is redisplayed.
if (reply == blink::WebAppBannerPromptReply::Cancel &&
!page_requested_prompt_) {
+ TrackDisplayEvent(DISPLAY_EVENT_CANCELED_BY_PAGE);
was_canceled_by_page_ = true;
referrer_ = referrer;
OutputDeveloperNotShownMessage(web_contents, kRendererRequestCancel,
@@ -212,6 +213,7 @@ void AppBannerDataFetcher::OnRequestShowAppBanner(
if (was_canceled_by_page_) {
// Simulate an "OK" from the website to restart the banner display pipeline.
was_canceled_by_page_ = false;
+ TrackDisplayEvent(DISPLAY_EVENT_PROMPTED_BY_PAGE);
OnBannerPromptReply(render_frame_host, request_id,
blink::WebAppBannerPromptReply::None, referrer_);
} else {
« no previous file with comments | « no previous file | chrome/browser/banners/app_banner_metrics.h » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698