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

Unified Diff: components/ntp_snippets/ntp_snippets_service.h

Issue 1997473004: Snippets are enabled when search suggestions are enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set shutdown_ Created 4 years, 7 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.h
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h
index a5bac53c11f3fe8e0bd2034c6e06dcb037ef7eed..3164a108209c160633d5f6c779e78dc8cfba0c99 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -64,6 +64,7 @@ class NTPSnippetsService : public KeyedService,
// the locale, so 'en_US' (English language with US locale) and 'en-GB_US'
// (British English person in the US) are not language codes.
NTPSnippetsService(
+ bool enabled,
PrefService* pref_service,
sync_driver::SyncService* sync_service,
suggestions::SuggestionsService* suggestions_service,
@@ -76,8 +77,6 @@ class NTPSnippetsService : public KeyedService,
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
- void Init(bool enabled);
-
// Inherited from KeyedService.
void Shutdown() override;
@@ -162,12 +161,12 @@ class NTPSnippetsService : public KeyedService,
// initializing and the sync state is not known.
bool IsSyncStateIncompatible();
- enum class State {
dgn 2016/05/24 16:38:35 treib@ is adding a LOADED state, and I'm adding a
Marc Treib 2016/05/24 16:55:24 +1 :)
Michael van Ouwerkerk 2016/05/24 16:58:09 Done.
- NOT_INITED,
- INITED,
- SHUT_DOWN
- } state_;
+ // Whether Shutdown has been called.
+ bool shutdown_;
+ // When |enabled_| is true the service will fetch snippets from the server
+ // using |snippets_fetcher_|, load snippets from device storage, and schedule
+ // the |scheduler_|.
bool enabled_;
PrefService* pref_service_;

Powered by Google App Engine
This is Rietveld 408576698