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

Unified Diff: chrome/browser/prefs/pref_metrics_service.cc

Issue 20722007: Only log HomePageIsNewTabPage if home button is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and reapply Created 7 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1d683caeef0fb51f99691839ddbf69dd3e5af159..025d9185d3dd11239390b801d405422d8a18b466 100644
--- a/chrome/browser/prefs/pref_metrics_service.cc
+++ b/chrome/browser/prefs/pref_metrics_service.cc
@@ -21,17 +21,19 @@ PrefMetricsService::~PrefMetricsService() {
}
void PrefMetricsService::RecordLaunchPrefs() {
- UMA_HISTOGRAM_BOOLEAN("Settings.ShowHomeButton",
- profile_->GetPrefs()->GetBoolean(prefs::kShowHomeButton));
- UMA_HISTOGRAM_BOOLEAN("Settings.HomePageIsNewTabPage",
- profile_->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage));
-
- int restore_on_startup = profile_->GetPrefs()->GetInteger(
- prefs::kRestoreOnStartup);
+ PrefService* prefs = profile_->GetPrefs();
+ bool showHomeButton = prefs->GetBoolean(prefs::kShowHomeButton);
+ bool homePageIsNewTabPage = prefs->GetBoolean(prefs::kHomePageIsNewTabPage);
+ UMA_HISTOGRAM_BOOLEAN("Settings.ShowHomeButton", showHomeButton);
+ if (showHomeButton) {
+ UMA_HISTOGRAM_BOOLEAN("Settings.HomePageIsNewTabPage",
+ homePageIsNewTabPage);
+ }
+ int restore_on_startup = prefs->GetInteger(prefs::kRestoreOnStartup);
UMA_HISTOGRAM_ENUMERATION("Settings.StartupPageLoadSettings",
restore_on_startup, SessionStartupPref::kPrefValueMax);
if (restore_on_startup == SessionStartupPref::kPrefValueURLs) {
- const int url_list_size = profile_->GetPrefs()->GetList(
+ const int url_list_size = prefs->GetList(
prefs::kURLsToRestoreOnStartup)->GetSize();
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Settings.StartupPageLoadURLs", url_list_size, 1, 50, 20);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698