Chromium Code Reviews| Index: chrome/browser/prefs/pref_metrics_service.cc |
| diff --git a/chrome/browser/prefs/pref_metrics_service.cc b/chrome/browser/prefs/pref_metrics_service.cc |
| index 54ee8505c59947eac378c7a6405f4ee6d2532bc2..f3685ba6d4d3340196c01583b5fdc087752ab53e 100644 |
| --- a/chrome/browser/prefs/pref_metrics_service.cc |
| +++ b/chrome/browser/prefs/pref_metrics_service.cc |
| @@ -78,13 +78,14 @@ PrefMetricsService::PrefMetricsService(Profile* profile, |
| PrefMetricsService::~PrefMetricsService() { |
| } |
| -void PrefMetricsService::RecordLaunchPrefs() { |
| - bool show_home_button = prefs_->GetBoolean(prefs::kShowHomeButton); |
| - bool home_page_is_ntp = prefs_->GetBoolean(prefs::kHomePageIsNewTabPage); |
| +// static |
| +void PrefMetricsService::RecordHomePageLaunchMetrics(bool show_home_button, |
| + bool homepage_is_ntp, |
| + const GURL& homepage_url) { |
| UMA_HISTOGRAM_BOOLEAN("Settings.ShowHomeButton", show_home_button); |
| if (show_home_button) { |
| UMA_HISTOGRAM_BOOLEAN("Settings.GivenShowHomeButton_HomePageIsNewTabPage", |
| - home_page_is_ntp); |
| + homepage_is_ntp); |
| } |
| // For non-NTP homepages, see if the URL comes from the same TLD+1 as a known |
| @@ -94,8 +95,7 @@ void PrefMetricsService::RecordLaunchPrefs() { |
| // (pages that share a TLD+1 with a known engine but aren't actually search |
| // pages, e.g. plus.google.com). Additionally, record the TLD+1 of non-NTP |
| // homepages through the privacy-preserving Rappor service. |
| - if (!home_page_is_ntp) { |
| - GURL homepage_url(prefs_->GetString(prefs::kHomePage)); |
| + if (!homepage_is_ntp) { |
| if (homepage_url.is_valid()) { |
| UMA_HISTOGRAM_ENUMERATION( |
| "Settings.HomePageEngineType", |
| @@ -106,6 +106,15 @@ void PrefMetricsService::RecordLaunchPrefs() { |
| homepage_url); |
| } |
| } |
| +} |
| + |
| +void PrefMetricsService::RecordLaunchPrefs() { |
| +#if !defined(OS_ANDROID) |
|
Mark P
2016/05/24 18:41:53
Please comment here why we skip it on Android (by
Ted C
2016/05/24 19:01:32
Done.
|
| + GURL homepage_url(prefs_->GetString(prefs::kHomePage)); |
| + RecordHomePageLaunchMetrics(prefs_->GetBoolean(prefs::kShowHomeButton), |
| + prefs_->GetBoolean(prefs::kHomePageIsNewTabPage), |
| + homepage_url); |
| +#endif |
| SampleNewTabPageURL(profile_); |
|
Mark P
2016/05/24 18:41:53
Given your answers to the comments on the earlier
Ted C
2016/05/24 19:01:33
Done.
|