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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 1997473004: Snippets are enabled when search suggestions are enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ios. 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.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index fc5edefc7194f06a9e925e68032c66acd8b0fc8f..0b5249915a736854ec3c3322e74bb2efa3919830 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -180,6 +180,7 @@ void WrapImageFetchedCallback(
} // namespace
NTPSnippetsService::NTPSnippetsService(
+ bool enabled,
PrefService* pref_service,
SuggestionsService* suggestions_service,
scoped_refptr<base::SequencedTaskRunner> file_task_runner,
@@ -188,7 +189,7 @@ NTPSnippetsService::NTPSnippetsService(
std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher,
std::unique_ptr<ImageFetcher> image_fetcher)
: state_(State::NOT_INITED),
- enabled_(false),
+ enabled_(enabled),
pref_service_(pref_service),
suggestions_service_(suggestions_service),
file_task_runner_(file_task_runner),
@@ -211,11 +212,10 @@ void NTPSnippetsService::RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterListPref(prefs::kSnippetHosts);
}
-void NTPSnippetsService::Init(bool enabled) {
+void NTPSnippetsService::Init() {
DCHECK(state_ == State::NOT_INITED);
state_ = State::INITED;
- enabled_ = enabled;
if (enabled_) {
// |suggestions_service_| can be null in tests.
if (snippets_fetcher_->UseHostRestriction() && suggestions_service_) {

Powered by Google App Engine
This is Rietveld 408576698