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

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

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
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 8b6f389f961c1d5cf0a3c24a9865c05651e721a3..cb166edcf8513170d99d7ca1bc45ff7b2164293b 100644
--- a/chrome/browser/prefs/pref_metrics_service.cc
+++ b/chrome/browser/prefs/pref_metrics_service.cc
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
sky 2014/02/12 01:06:50 No need to change this.
Steven Holte 2014/02/12 04:02:55 Done.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,6 +22,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_service.h"
#include "crypto/hmac.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -70,7 +71,8 @@ void PrefMetricsService::RecordLaunchPrefs() {
// use, due to both false negatives (pages that come from unknown TLD+1 X but
// consist of a search box that sends to known TLD+1 Y) and false positives
// (pages that share a TLD+1 with a known engine but aren't actually search
- // pages, e.g. plus.google.com).
+ // 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_url.is_valid()) {
@@ -78,6 +80,11 @@ void PrefMetricsService::RecordLaunchPrefs() {
"Settings.HomePageEngineType",
TemplateURLPrepopulateData::GetEngineType(homepage_url),
SEARCH_ENGINE_MAX);
+ g_browser_process->rappor_service()->RecordSample(
sky 2014/02/12 01:06:50 Don't you need to NULL check rappor_service()? Tes
Steven Holte 2014/02/12 04:02:55 I think there might not be tests that run this cod
+ "Settings.HomePage",
+ rappor::ETLD_PLUS_ONE_RAPPOR_TYPE,
+ net::registry_controlled_domains::GetDomainAndRegistry(homepage_url,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES));
}
}

Powered by Google App Engine
This is Rietveld 408576698