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 6bbfa4aa0a7e61e98e8097d4662c3c2a15046e41..8083f6ece523c8f666a0a869c3cc8a783d4b6ffe 100644 |
--- a/chrome/browser/prefs/pref_metrics_service.cc |
+++ b/chrome/browser/prefs/pref_metrics_service.cc |
@@ -28,6 +28,7 @@ |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" |
+#include "components/rappor/rappor_recorder.h" |
#include "crypto/hmac.h" |
#include "grit/browser_resources.h" |
#include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
@@ -129,6 +130,15 @@ PrefMetricsService::PrefMetricsService(Profile* profile, |
PrefMetricsService::~PrefMetricsService() { |
} |
+static void GetUrlParts(const GURL& url, std::vector<std::string>* strs) { |
+ strs->push_back(url.spec()); |
+ strs->push_back(url.host()); |
+ // TODO(holte) break up host more |
+ strs->push_back(url.query()); |
+ strs->push_back(url.path()); |
+ // strs.push_back(url.ref()); |
+} |
+ |
void PrefMetricsService::RecordLaunchPrefs() { |
bool show_home_button = prefs_->GetBoolean(prefs::kShowHomeButton); |
bool home_page_is_ntp = prefs_->GetBoolean(prefs::kHomePageIsNewTabPage); |
@@ -151,6 +161,9 @@ void PrefMetricsService::RecordLaunchPrefs() { |
"Settings.HomePageEngineType", |
TemplateURLPrepopulateData::GetEngineType(homepage_url), |
SEARCH_ENGINE_MAX); |
+ std::vector<std::string> url_parts; |
+ GetUrlParts(homepage_url, &url_parts); |
+ RAPPOR_SAMPLE("Settings.HomePage", url_parts); |
} |
} |