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

Unified Diff: chrome/browser/ntp_snippets/ntp_snippets_service_factory.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: chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
diff --git a/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc b/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
index 4e3a6865d61a22fc7cd93d1a8d77468ab2bed539..8e2ca4a5aa0a6509a48c2b8008dc065dd45566fe 100644
--- a/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
+++ b/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/channel_info.h"
-#include "chrome/common/pref_names.h"
#include "components/browser_sync/browser/profile_sync_service.h"
#include "components/image_fetcher/image_decoder.h"
#include "components/image_fetcher/image_fetcher.h"
@@ -89,12 +88,9 @@ KeyedService* NTPSnippetsServiceFactory::BuildServiceInstanceFor(
// need to be created if content_suggestions_service->state() == DISABLED,
// just return nullptr then and remove the other "if" below.
- // TODO(mvanouwerkerk): Move the enable logic into the service once we start
- // observing pref changes.
bool enabled = false;
#if defined(OS_ANDROID)
- enabled = profile->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled) &&
- base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature);
+ enabled = base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature);
#endif // OS_ANDROID
SigninManagerBase* signin_manager =
@@ -136,7 +132,7 @@ KeyedService* NTPSnippetsServiceFactory::BuildServiceInstanceFor(
base::MakeUnique<ntp_snippets::NTPSnippetsDatabase>(database_dir,
task_runner),
base::MakeUnique<ntp_snippets::NTPSnippetsStatusService>(
- signin_manager, sync_service));
+ signin_manager, sync_service, profile->GetPrefs()));
if (content_suggestions_service->state() ==
ContentSuggestionsService::State::ENABLED) {
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.h » ('j') | components/ntp_snippets/ntp_snippets_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698