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..5de7d9ee56aca114ca91ed016dc3428dfc208de0 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,9 +106,27 @@ void PrefMetricsService::RecordLaunchPrefs() { |
| homepage_url); |
| } |
| } |
| +} |
| +void PrefMetricsService::RecordLaunchPrefs() { |
| + // On Android, determining whether the homepage is enabled requires waiting |
| + // for a response from a third party provider installed on the device. So, |
| + // it will be logged later once all the dependent information is available. |
|
Mark P
2016/05/24 19:07:17
nit: point readers to the call site for this other
Ted C
2016/05/24 19:55:53
Done
|
| +#if !defined(OS_ANDROID) |
| + GURL homepage_url(prefs_->GetString(prefs::kHomePage)); |
| + RecordHomePageLaunchMetrics(prefs_->GetBoolean(prefs::kShowHomeButton), |
| + prefs_->GetBoolean(prefs::kHomePageIsNewTabPage), |
| + homepage_url); |
| +#endif |
| + |
| + // Android does not support overriding the NTP URL. |
| +#if !defined(OS_ANDROID) |
| SampleNewTabPageURL(profile_); |
| +#endif |
| + // Tab restoring is always done on Android, so these metrics are not |
| + // applicable. Also, startup pages are not supported on Android |
| +#if !defined(OS_ANDROID) |
| int restore_on_startup = prefs_->GetInteger(prefs::kRestoreOnStartup); |
| UMA_HISTOGRAM_ENUMERATION("Settings.StartupPageLoadSettings", |
| restore_on_startup, kSessionStartupPrefValueMax); |
| @@ -136,7 +154,9 @@ void PrefMetricsService::RecordLaunchPrefs() { |
| } |
| } |
| } |
| +#endif |
| + // Android does not support pinned tabs. |
| #if !defined(OS_ANDROID) |
| StartupTabs startup_tabs = PinnedTabCodec::ReadPinnedTabs(profile_); |
| UMA_HISTOGRAM_CUSTOM_COUNTS("Settings.PinnedTabs", |