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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2158373002: [NTP Snippets] Add a pref to disable the NTPSnippetsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
Index: components/ntp_snippets/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index fc3ff800a0df056db1dfd871d2462c917971c4a1..ca63138747052ae91e88db47245ea2083b293a85 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -237,6 +237,8 @@ NTPSnippetsService::~NTPSnippetsService() {
// static
void NTPSnippetsService::RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterListPref(prefs::kSnippetHosts);
+
+ NTPSnippetsStatusService::RegisterProfilePrefs(registry);
}
// Inherited from KeyedService.
@@ -693,12 +695,13 @@ void NTPSnippetsService::FinishInitialization() {
// Note: Initializing the status service will run the callback right away with
// the current state.
snippets_status_service_->Init(base::Bind(
- &NTPSnippetsService::UpdateStateForStatus, base::Unretained(this)));
+ &NTPSnippetsService::OnDisabledReasonChanged, base::Unretained(this)));
NotifyNewSuggestions();
}
-void NTPSnippetsService::UpdateStateForStatus(DisabledReason disabled_reason) {
+void NTPSnippetsService::OnDisabledReasonChanged(
+ DisabledReason disabled_reason) {
FOR_EACH_OBSERVER(NTPSnippetsServiceObserver, observers_,
NTPSnippetsServiceDisabledReasonChanged(disabled_reason));

Powered by Google App Engine
This is Rietveld 408576698