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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2790183002: Add UMA for the content suggestions settings (Closed)
Patch Set: address comments and rebase Created 3 years, 8 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: components/ntp_snippets/content_suggestions_service.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 7ebd8471c5134dbfff58ab360f302dab369da5e4..cb54bbb7174ea315ab0aadb7be7a8bc94160f247 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -19,6 +19,7 @@
#include "components/favicon/core/large_icon_service.h"
#include "components/favicon_base/fallback_icon_style.h"
#include "components/favicon_base/favicon_types.h"
+#include "components/ntp_snippets/content_suggestions_metrics.h"
#include "components/ntp_snippets/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
@@ -54,6 +55,7 @@ ContentSuggestionsService::ContentSuggestionsService(
}
RestoreDismissedCategoriesFromPrefs();
+ metrics::RecordRemoteSuggestionsProviderState(AreRemoteSuggestionsEnabled());
}
ContentSuggestionsService::~ContentSuggestionsService() = default;
@@ -345,21 +347,19 @@ void ContentSuggestionsService::ReloadSuggestions() {
}
}
-void ContentSuggestionsService::SetRemoteSuggestionsServiceEnabled(
- bool enabled) {
+void ContentSuggestionsService::SetRemoteSuggestionsEnabled(bool enabled) {
pref_service_->SetBoolean(prefs::kEnableSnippets, enabled);
}
-bool ContentSuggestionsService::IsRemoteSuggestionsServiceEnabled() const {
+bool ContentSuggestionsService::AreRemoteSuggestionsEnabled() const {
return pref_service_->GetBoolean(prefs::kEnableSnippets);
}
-bool ContentSuggestionsService::IsRemoteSuggestionsServiceManaged() const {
+bool ContentSuggestionsService::AreRemoteSuggestionsManaged() const {
return pref_service_->IsManagedPreference(prefs::kEnableSnippets);
}
-bool ContentSuggestionsService::IsRemoteSuggestionsServiceManagedByCustodian()
- const {
+bool ContentSuggestionsService::AreRemoteSuggestionsManagedByCustodian() const {
return pref_service_->IsPreferenceManagedByCustodian(prefs::kEnableSnippets);
}
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.h ('k') | components/ntp_snippets/content_suggestions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698