Commit 1a0c79a8 authored by Robert Kaplow's avatar Robert Kaplow Committed by Commit Bot

Remove RAPPOR metrics related to search and settings.

Bug: 1016906
Change-Id: I1e682a4bfd221463baa95849a73586b0e3c993cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943534Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Auto-Submit: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721464}
parent 0fbbfb22
...@@ -19,32 +19,9 @@ ...@@ -19,32 +19,9 @@
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/rappor/public/rappor_utils.h"
#include "components/rappor/rappor_service_impl.h"
#include "components/search_engines/template_url_prepopulate_data.h" #include "components/search_engines/template_url_prepopulate_data.h"
#include "content/public/browser/browser_url_handler.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace {
#if !defined(OS_ANDROID)
// Record a sample for the Settings.NewTabPage rappor metric.
void SampleNewTabPageURL(Profile* profile) {
GURL ntp_url(chrome::kChromeUINewTabURL);
bool reverse_on_redirect = false;
content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
&ntp_url,
profile,
&reverse_on_redirect);
if (ntp_url.is_valid()) {
rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
"Settings.NewTabPage", ntp_url);
}
}
#endif
} // namespace
PrefMetricsService::PrefMetricsService(Profile* profile) PrefMetricsService::PrefMetricsService(Profile* profile)
: profile_(profile), prefs_(profile_->GetPrefs()) { : profile_(profile), prefs_(profile_->GetPrefs()) {
RecordLaunchPrefs(); RecordLaunchPrefs();
...@@ -68,17 +45,13 @@ void PrefMetricsService::RecordHomePageLaunchMetrics(bool show_home_button, ...@@ -68,17 +45,13 @@ void PrefMetricsService::RecordHomePageLaunchMetrics(bool show_home_button,
// use, due to both false negatives (pages that come from unknown TLD+1 X but // 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 // 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 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 // pages, e.g. plus.google.com).
// homepages through the privacy-preserving Rappor service.
if (!homepage_is_ntp) { if (!homepage_is_ntp) {
if (homepage_url.is_valid()) { if (homepage_url.is_valid()) {
UMA_HISTOGRAM_ENUMERATION( UMA_HISTOGRAM_ENUMERATION(
"Settings.HomePageEngineType", "Settings.HomePageEngineType",
TemplateURLPrepopulateData::GetEngineType(homepage_url), TemplateURLPrepopulateData::GetEngineType(homepage_url),
SEARCH_ENGINE_MAX); SEARCH_ENGINE_MAX);
rappor::SampleDomainAndRegistryFromGURL(
g_browser_process->rappor_service(), "Settings.HomePage2",
homepage_url);
} }
} }
} }
...@@ -95,13 +68,8 @@ void PrefMetricsService::RecordLaunchPrefs() { ...@@ -95,13 +68,8 @@ void PrefMetricsService::RecordLaunchPrefs() {
homepage_url); homepage_url);
#endif #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 // Tab restoring is always done on Android, so these metrics are not
// applicable. Also, startup pages are not supported on Android // applicable. Also, startup pages are not supported on Android.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
int restore_on_startup = prefs_->GetInteger(prefs::kRestoreOnStartup); int restore_on_startup = prefs_->GetInteger(prefs::kRestoreOnStartup);
UMA_HISTOGRAM_ENUMERATION( UMA_HISTOGRAM_ENUMERATION(
...@@ -120,11 +88,6 @@ void PrefMetricsService::RecordLaunchPrefs() { ...@@ -120,11 +88,6 @@ void PrefMetricsService::RecordLaunchPrefs() {
"Settings.StartupPageEngineTypes", "Settings.StartupPageEngineTypes",
TemplateURLPrepopulateData::GetEngineType(start_url), TemplateURLPrepopulateData::GetEngineType(start_url),
SEARCH_ENGINE_MAX); SEARCH_ENGINE_MAX);
if (i == 0) {
rappor::SampleDomainAndRegistryFromGURL(
g_browser_process->rappor_service(),
"Settings.FirstStartupPage", start_url);
}
} }
} }
} }
......
...@@ -67,5 +67,5 @@ std::unique_ptr<KeyedService> CreateTemplateURLServiceForTesting( ...@@ -67,5 +67,5 @@ std::unique_ptr<KeyedService> CreateTemplateURLServiceForTesting(
profile->GetPrefs(), std::make_unique<UIThreadSearchTermsData>(), profile->GetPrefs(), std::make_unique<UIThreadSearchTermsData>(),
WebDataServiceFactory::GetKeywordWebDataForProfile( WebDataServiceFactory::GetKeywordWebDataForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS), profile, ServiceAccessType::EXPLICIT_ACCESS),
nullptr, nullptr, base::Closure()); nullptr /* TemplateURLServiceClient */, base::Closure());
} }
...@@ -56,7 +56,7 @@ std::unique_ptr<KeyedService> TemplateURLServiceFactory::BuildInstanceFor( ...@@ -56,7 +56,7 @@ std::unique_ptr<KeyedService> TemplateURLServiceFactory::BuildInstanceFor(
new ChromeTemplateURLServiceClient( new ChromeTemplateURLServiceClient(
HistoryServiceFactory::GetForProfile( HistoryServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS))), profile, ServiceAccessType::EXPLICIT_ACCESS))),
g_browser_process->rappor_service(), dsp_change_callback); dsp_change_callback);
} }
TemplateURLServiceFactory::TemplateURLServiceFactory() TemplateURLServiceFactory::TemplateURLServiceFactory()
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "chrome/browser/search_engines/template_url_service_test_util.h" #include "chrome/browser/search_engines/template_url_service_test_util.h"
#include <utility>
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
...@@ -135,7 +137,7 @@ void TemplateURLServiceTestUtil::ResetModel(bool verify_load) { ...@@ -135,7 +137,7 @@ void TemplateURLServiceTestUtil::ResetModel(bool verify_load) {
HistoryServiceFactory::GetForProfileIfExists( HistoryServiceFactory::GetForProfileIfExists(
profile(), ServiceAccessType::EXPLICIT_ACCESS), profile(), ServiceAccessType::EXPLICIT_ACCESS),
&search_term_)), &search_term_)),
nullptr, base::Closure())); base::Closure()));
model()->AddObserver(this); model()->AddObserver(this);
changed_count_ = 0; changed_count_ = 0;
if (verify_load) if (verify_load)
......
...@@ -131,8 +131,9 @@ class BookmarkBarViewTest : public BrowserWithTestWindowTest { ...@@ -131,8 +131,9 @@ class BookmarkBarViewTest : public BrowserWithTestWindowTest {
content::BrowserContext* profile) { content::BrowserContext* profile) {
return std::make_unique<TemplateURLService>( return std::make_unique<TemplateURLService>(
static_cast<Profile*>(profile)->GetPrefs(), static_cast<Profile*>(profile)->GetPrefs(),
std::make_unique<SearchTermsData>(), nullptr, nullptr, nullptr, std::make_unique<SearchTermsData>(),
base::Closure()); nullptr /* KeywordWebDataService */,
nullptr /* TemplateURLServiceClient */, base::Closure());
} }
DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewTest); DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewTest);
......
...@@ -50,7 +50,7 @@ std::unique_ptr<KeyedService> CreateTemplateURLService( ...@@ -50,7 +50,7 @@ std::unique_ptr<KeyedService> CreateTemplateURLService(
std::make_unique<ChromeTemplateURLServiceClient>( std::make_unique<ChromeTemplateURLServiceClient>(
HistoryServiceFactory::GetForProfile( HistoryServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS)), profile, ServiceAccessType::EXPLICIT_ACCESS)),
nullptr, base::Closure()); base::Closure());
} }
std::unique_ptr<KeyedService> CreateAutocompleteClassifier( std::unique_ptr<KeyedService> CreateAutocompleteClassifier(
......
...@@ -76,9 +76,10 @@ class BaseSearchProviderTest : public testing::Test { ...@@ -76,9 +76,10 @@ class BaseSearchProviderTest : public testing::Test {
void SetUp() override { void SetUp() override {
std::unique_ptr<TemplateURLService> template_url_service( std::unique_ptr<TemplateURLService> template_url_service(
new TemplateURLService( new TemplateURLService(
nullptr, std::unique_ptr<SearchTermsData>(new SearchTermsData), nullptr /* PrefService */,
nullptr, std::unique_ptr<TemplateURLServiceClient>(), nullptr, std::unique_ptr<SearchTermsData>(new SearchTermsData),
base::Closure())); nullptr /* KeywordWebDataService */,
std::unique_ptr<TemplateURLServiceClient>(), base::Closure()));
client_.reset(new MockAutocompleteProviderClient()); client_.reset(new MockAutocompleteProviderClient());
client_->set_template_url_service(std::move(template_url_service)); client_->set_template_url_service(std::move(template_url_service));
provider_ = new NiceMock<TestBaseSearchProvider>( provider_ = new NiceMock<TestBaseSearchProvider>(
......
...@@ -45,9 +45,10 @@ TestOmniboxClient::CreateAutocompleteProviderClient() { ...@@ -45,9 +45,10 @@ TestOmniboxClient::CreateAutocompleteProviderClient() {
std::unique_ptr<TemplateURLService> template_url_service( std::unique_ptr<TemplateURLService> template_url_service(
new TemplateURLService( new TemplateURLService(
nullptr, std::unique_ptr<SearchTermsData>(new SearchTermsData), nullptr /* PrefService */,
nullptr, std::unique_ptr<TemplateURLServiceClient>(), nullptr, std::unique_ptr<SearchTermsData>(new SearchTermsData),
base::Closure())); nullptr /* KeywordWebDataService */,
std::unique_ptr<TemplateURLServiceClient>(), base::Closure()));
// Save a reference to the created TemplateURLService for test use. // Save a reference to the created TemplateURLService for test use.
template_url_service_ = template_url_service.get(); template_url_service_ = template_url_service.get();
......
...@@ -64,7 +64,6 @@ static_library("search_engines") { ...@@ -64,7 +64,6 @@ static_library("search_engines") {
"//components/history/core/browser", "//components/history/core/browser",
"//components/infobars/core", "//components/infobars/core",
"//components/pref_registry", "//components/pref_registry",
"//components/rappor",
"//components/strings", "//components/strings",
"//components/url_formatter", "//components/url_formatter",
"//components/variations", "//components/variations",
......
...@@ -7,7 +7,6 @@ include_rules = [ ...@@ -7,7 +7,6 @@ include_rules = [
"+components/policy", "+components/policy",
"+components/pref_registry", "+components/pref_registry",
"+components/prefs", "+components/prefs",
"+components/rappor",
"+components/strings/grit/components_strings.h", "+components/strings/grit/components_strings.h",
"+components/sync", "+components/sync",
"+components/sync_preferences/testing_pref_service_syncable.h", "+components/sync_preferences/testing_pref_service_syncable.h",
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/rappor/rappor_service_impl.h"
#include "components/search_engines/search_engines_pref_names.h" #include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_terms_data.h" #include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url_prepopulate_data.h" #include "components/search_engines/template_url_prepopulate_data.h"
...@@ -282,13 +281,11 @@ TemplateURLService::TemplateURLService( ...@@ -282,13 +281,11 @@ TemplateURLService::TemplateURLService(
std::unique_ptr<SearchTermsData> search_terms_data, std::unique_ptr<SearchTermsData> search_terms_data,
const scoped_refptr<KeywordWebDataService>& web_data_service, const scoped_refptr<KeywordWebDataService>& web_data_service,
std::unique_ptr<TemplateURLServiceClient> client, std::unique_ptr<TemplateURLServiceClient> client,
rappor::RapporServiceImpl* rappor_service,
const base::Closure& dsp_change_callback) const base::Closure& dsp_change_callback)
: prefs_(prefs), : prefs_(prefs),
search_terms_data_(std::move(search_terms_data)), search_terms_data_(std::move(search_terms_data)),
web_data_service_(web_data_service), web_data_service_(web_data_service),
client_(std::move(client)), client_(std::move(client)),
rappor_service_(rappor_service),
dsp_change_callback_(dsp_change_callback), dsp_change_callback_(dsp_change_callback),
default_search_manager_( default_search_manager_(
prefs_, prefs_,
...@@ -874,14 +871,6 @@ void TemplateURLService::OnWebDataServiceRequestDone( ...@@ -874,14 +871,6 @@ void TemplateURLService::OnWebDataServiceRequestDone(
"Search.DefaultSearchProviderType", "Search.DefaultSearchProviderType",
default_search_provider_->GetEngineType(search_terms_data()), default_search_provider_->GetEngineType(search_terms_data()),
SEARCH_ENGINE_MAX); SEARCH_ENGINE_MAX);
if (rappor_service_) {
rappor_service_->RecordSampleString(
"Search.DefaultSearchProvider", rappor::ETLD_PLUS_ONE_RAPPOR_TYPE,
net::registry_controlled_domains::GetDomainAndRegistry(
default_search_provider_->url_ref().GetHost(search_terms_data()),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES));
}
} }
} }
......
...@@ -44,10 +44,6 @@ struct TemplateURLData; ...@@ -44,10 +44,6 @@ struct TemplateURLData;
class TemplateUrlServiceAndroid; class TemplateUrlServiceAndroid;
#endif #endif
namespace rappor {
class RapporServiceImpl;
}
namespace syncer { namespace syncer {
class SyncData; class SyncData;
class SyncErrorFactory; class SyncErrorFactory;
...@@ -112,7 +108,6 @@ class TemplateURLService : public WebDataServiceConsumer, ...@@ -112,7 +108,6 @@ class TemplateURLService : public WebDataServiceConsumer,
std::unique_ptr<SearchTermsData> search_terms_data, std::unique_ptr<SearchTermsData> search_terms_data,
const scoped_refptr<KeywordWebDataService>& web_data_service, const scoped_refptr<KeywordWebDataService>& web_data_service,
std::unique_ptr<TemplateURLServiceClient> client, std::unique_ptr<TemplateURLServiceClient> client,
rappor::RapporServiceImpl* rappor_service,
const base::RepeatingClosure& dsp_change_callback); const base::RepeatingClosure& dsp_change_callback);
// The following is for testing. // The following is for testing.
TemplateURLService(const Initializer* initializers, const int count); TemplateURLService(const Initializer* initializers, const int count);
...@@ -742,9 +737,6 @@ class TemplateURLService : public WebDataServiceConsumer, ...@@ -742,9 +737,6 @@ class TemplateURLService : public WebDataServiceConsumer,
std::unique_ptr<TemplateURLServiceClient> client_; std::unique_ptr<TemplateURLServiceClient> client_;
// ---------- Metrics related members ---------------------------------------
rappor::RapporServiceImpl* rappor_service_ = nullptr;
// This closure is run when the default search provider is set to Google. // This closure is run when the default search provider is set to Google.
base::RepeatingClosure dsp_change_callback_; base::RepeatingClosure dsp_change_callback_;
......
...@@ -49,7 +49,6 @@ std::unique_ptr<KeyedService> BuildTemplateURLService( ...@@ -49,7 +49,6 @@ std::unique_ptr<KeyedService> BuildTemplateURLService(
std::make_unique<ios::TemplateURLServiceClientImpl>( std::make_unique<ios::TemplateURLServiceClientImpl>(
ios::HistoryServiceFactory::GetForBrowserState( ios::HistoryServiceFactory::GetForBrowserState(
browser_state, ServiceAccessType::EXPLICIT_ACCESS)), browser_state, ServiceAccessType::EXPLICIT_ACCESS)),
GetApplicationContext()->GetRapporServiceImpl(),
GetDefaultSearchProviderChangedCallback()); GetDefaultSearchProviderChangedCallback());
} }
......
...@@ -319,39 +319,6 @@ components/rappor/rappor_parameters.h. ...@@ -319,39 +319,6 @@ components/rappor/rappor_parameters.h.
</flags-field> </flags-field>
</rappor-metric> </rappor-metric>
<rappor-metric name="Search.DefaultSearchProvider" type="ETLD_PLUS_ONE">
<owner>holte@chromium.org</owner>
<summary>
The domain and registry of the URL for the default search engine. Recorded
when a profile is opened or after a profile reset.
</summary>
</rappor-metric>
<rappor-metric name="Settings.FirstStartupPage" type="ETLD_PLUS_ONE">
<owner>holte@chromium.org</owner>
<summary>
The domain and registry of the URL of the first page opened on startup.
Recorded when a profile is loaded if preferences specify a fixed set of URLs
to open on startup.
</summary>
</rappor-metric>
<rappor-metric name="Settings.HomePage2" type="ETLD_PLUS_ONE">
<owner>holte@chromium.org</owner>
<summary>
The eTLD+1 of the prefs::kHomePage setting. Recorded when a profile is
loaded if the URL is valid and prefs::kHomePageIsNewTabPage is false.
</summary>
</rappor-metric>
<rappor-metric name="Settings.NewTabPage" type="ETLD_PLUS_ONE">
<owner>holte@chromium.org</owner>
<summary>
The domain and registry of the URL chrome://newtab is rewritten to. Recorded
when a profile is loaded, if the URL is valid.
</summary>
</rappor-metric>
</rappor-metrics> </rappor-metrics>
</rappor-configuration> </rappor-configuration>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment