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

Unified Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc

Issue 2655263003: [NTP] Remove the ScrollView version of the NTP. (Closed)
Patch Set: Cleaned up some more. Created 3 years, 11 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
« no previous file with comments | « chrome/browser/android/chrome_feature_list.cc ('k') | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
index 5c94f1080023db8dc611830f12445b635d760e7d..e0f418857497c4908ad8ccb0f606102ccc1bd9a6 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -97,13 +97,6 @@ using translate::LanguageModel;
namespace {
-// Clear the tasks that can be scheduled by running services.
-void ClearScheduledTasks() {
-#if defined(OS_ANDROID)
- NTPSnippetsLauncher::Get()->Unschedule();
-#endif // OS_ANDROID
-}
-
#if defined(OS_ANDROID)
bool IsRecentTabProviderEnabled() {
@@ -265,10 +258,6 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
DCHECK(!profile->IsOffTheRecord());
// Create the ContentSuggestionsService.
- State state =
- base::FeatureList::IsEnabled(ntp_snippets::kContentSuggestionsFeature)
- ? State::ENABLED
- : State::DISABLED;
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
HistoryService* history_service = HistoryServiceFactory::GetForProfile(
@@ -278,14 +267,8 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
ntp_snippets::BuildSelectedCategoryRanker(
pref_service, base::MakeUnique<base::DefaultClock>());
auto* service =
- new ContentSuggestionsService(state, signin_manager, history_service,
- pref_service, std::move(category_ranker));
- if (state == State::DISABLED) {
- // Since we won't initialise the services, they won't get a chance to
- // unschedule their tasks. We do it explicitly here instead.
- ClearScheduledTasks();
- return service;
- }
+ new ContentSuggestionsService(State::ENABLED, signin_manager,
+ history_service, pref_service, std::move(category_ranker));
#if defined(OS_ANDROID)
OfflinePageModel* offline_page_model =
« no previous file with comments | « chrome/browser/android/chrome_feature_list.cc ('k') | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698