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

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

Issue 2259553002: Make AppBannerInfoBar install WebAPK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move logic to WebApkInstaller. Created 4 years, 4 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/banners/app_banner_settings_helper.cc
diff --git a/chrome/browser/banners/app_banner_settings_helper.cc b/chrome/browser/banners/app_banner_settings_helper.cc
index f384ca2feb27d87b0c714693844b0ddc03036e99..5fedc2cf8830a5fb2310cacca148bc8ac0773380 100644
--- a/chrome/browser/banners/app_banner_settings_helper.cc
+++ b/chrome/browser/banners/app_banner_settings_helper.cc
@@ -197,6 +197,16 @@ void UpdateMinutesBetweenVisits() {
}
}
+std::string getMetric(
dominickn 2016/08/25 04:25:56 This should return const std::string or a base::St
Xi Han 2016/08/26 17:04:18 Done.
+ const AppBannerSettingsHelper::AppBannerRapporMetric& rappor_metric) {
+ if (rappor_metric == AppBannerSettingsHelper::NATIVE)
+ return "AppBanner.NativeApp.Installed";
+ else if (rappor_metric == AppBannerSettingsHelper::WEB)
+ return "AppBanner.WebApp.Installed";
+ else
+ return "AppBanner.WebApk.Installed";
+}
+
} // namespace
void AppBannerSettingsHelper::ClearHistoryForURLs(
@@ -225,8 +235,7 @@ void AppBannerSettingsHelper::RecordBannerInstallEvent(
rappor::SampleDomainAndRegistryFromGURL(
g_browser_process->rappor_service(),
- (rappor_metric == WEB ? "AppBanner.WebApp.Installed"
- : "AppBanner.NativeApp.Installed"),
+ getMetric(rappor_metric),
web_contents->GetURL());
}
@@ -243,8 +252,7 @@ void AppBannerSettingsHelper::RecordBannerDismissEvent(
rappor::SampleDomainAndRegistryFromGURL(
g_browser_process->rappor_service(),
- (rappor_metric == WEB ? "AppBanner.WebApp.Dismissed"
- : "AppBanner.NativeApp.Dismissed"),
+ getMetric(rappor_metric),
web_contents->GetURL());
}

Powered by Google App Engine
This is Rietveld 408576698