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()); |
} |