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

Side by Side Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc

Issue 2560783002: [NTP::PhysicalWeb] Implement suggestion dismissal. (Closed)
Patch Set: rebase and jkrcal@ comment. Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" 5 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 PrefService* pref_service) { 127 PrefService* pref_service) {
128 auto provider = base::MakeUnique<BookmarkSuggestionsProvider>( 128 auto provider = base::MakeUnique<BookmarkSuggestionsProvider>(
129 service, category_factory, bookmark_model, pref_service); 129 service, category_factory, bookmark_model, pref_service);
130 service->RegisterProvider(std::move(provider)); 130 service->RegisterProvider(std::move(provider));
131 } 131 }
132 132
133 #if defined(OS_ANDROID) 133 #if defined(OS_ANDROID)
134 void RegisterPhysicalWebPageProvider( 134 void RegisterPhysicalWebPageProvider(
135 ContentSuggestionsService* service, 135 ContentSuggestionsService* service,
136 CategoryFactory* category_factory, 136 CategoryFactory* category_factory,
137 PhysicalWebDataSource* physical_web_data_source) { 137 PhysicalWebDataSource* physical_web_data_source,
138 PrefService* pref_service) {
138 auto provider = base::MakeUnique<PhysicalWebPageSuggestionsProvider>( 139 auto provider = base::MakeUnique<PhysicalWebPageSuggestionsProvider>(
139 service, category_factory, physical_web_data_source); 140 service, category_factory, physical_web_data_source, pref_service);
140 service->RegisterProvider(std::move(provider)); 141 service->RegisterProvider(std::move(provider));
141 } 142 }
142 #endif // OS_ANDROID 143 #endif // OS_ANDROID
143 144
144 void RegisterArticleProvider(SigninManagerBase* signin_manager, 145 void RegisterArticleProvider(SigninManagerBase* signin_manager,
145 OAuth2TokenService* token_service, 146 OAuth2TokenService* token_service,
146 ContentSuggestionsService* service, 147 ContentSuggestionsService* service,
147 CategoryFactory* category_factory, 148 CategoryFactory* category_factory,
148 LanguageModel* language_model, 149 LanguageModel* language_model,
149 PrefService* pref_service, 150 PrefService* pref_service,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (base::FeatureList::IsEnabled(ntp_snippets::kBookmarkSuggestionsFeature) && 301 if (base::FeatureList::IsEnabled(ntp_snippets::kBookmarkSuggestionsFeature) &&
301 bookmark_model) { 302 bookmark_model) {
302 RegisterBookmarkProvider(bookmark_model, service, category_factory, 303 RegisterBookmarkProvider(bookmark_model, service, category_factory,
303 pref_service); 304 pref_service);
304 } 305 }
305 306
306 #if defined(OS_ANDROID) 307 #if defined(OS_ANDROID)
307 if (base::FeatureList::IsEnabled( 308 if (base::FeatureList::IsEnabled(
308 ntp_snippets::kPhysicalWebPageSuggestionsFeature)) { 309 ntp_snippets::kPhysicalWebPageSuggestionsFeature)) {
309 RegisterPhysicalWebPageProvider(service, category_factory, 310 RegisterPhysicalWebPageProvider(service, category_factory,
310 physical_web_data_source); 311 physical_web_data_source, pref_service);
311 } 312 }
312 #endif // OS_ANDROID 313 #endif // OS_ANDROID
313 314
314 if (base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)) { 315 if (base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)) {
315 RegisterArticleProvider(signin_manager, token_service, service, 316 RegisterArticleProvider(signin_manager, token_service, service,
316 category_factory, language_model, pref_service, 317 category_factory, language_model, pref_service,
317 profile); 318 profile);
318 } 319 }
319 320
320 if (base::FeatureList::IsEnabled( 321 if (base::FeatureList::IsEnabled(
321 ntp_snippets::kForeignSessionsSuggestionsFeature)) { 322 ntp_snippets::kForeignSessionsSuggestionsFeature)) {
322 RegisterForeignSessionsProvider(sync_service, service, category_factory, 323 RegisterForeignSessionsProvider(sync_service, service, category_factory,
323 pref_service); 324 pref_service);
324 } 325 }
325 326
326 return service; 327 return service;
327 } 328 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698