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

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

Issue 2517113005: [NTP::PhysicalWeb] Wire Physical Web provider to the data source. (Closed)
Patch Set: rebase and treib@ comment. Created 4 years, 1 month 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 | « no previous file | components/ntp_snippets/BUILD.gn » ('j') | components/ntp_snippets/BUILD.gn » ('J')
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 f30de06f5d4d7676e404a0ef7b08781039d6db7e..301625c2541bbc05e8525b8621b174d03be685c9 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -60,6 +60,7 @@
#include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h"
#include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h"
#include "components/offline_pages/offline_page_model.h"
+#include "components/physical_web/data_source/physical_web_data_source.h"
using content::DownloadManager;
using ntp_snippets::PhysicalWebPageSuggestionsProvider;
@@ -129,10 +130,12 @@ void RegisterBookmarkProvider(BookmarkModel* bookmark_model,
}
#if defined(OS_ANDROID)
-void RegisterPhysicalWebPageProvider(ContentSuggestionsService* service,
- CategoryFactory* category_factory) {
+void RegisterPhysicalWebPageProvider(
+ ContentSuggestionsService* service,
+ CategoryFactory* category_factory,
+ PhysicalWebDataSource* physical_web_data_source) {
auto provider = base::MakeUnique<PhysicalWebPageSuggestionsProvider>(
- service, category_factory);
+ service, category_factory, physical_web_data_source);
service->RegisterProvider(std::move(provider));
}
#endif // OS_ANDROID
@@ -260,6 +263,8 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
OfflinePageModelFactory::GetForBrowserContext(profile);
DownloadManager* download_manager =
content::BrowserContext::GetDownloadManager(profile);
+ PhysicalWebDataSource* physical_web_data_source =
+ g_browser_process->GetPhysicalWebDataSource();
#endif // OS_ANDROID
BookmarkModel* bookmark_model =
BookmarkModelFactory::GetForBrowserContext(profile);
@@ -299,7 +304,8 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
#if defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(
ntp_snippets::kPhysicalWebPageSuggestionsFeature)) {
- RegisterPhysicalWebPageProvider(service, category_factory);
+ RegisterPhysicalWebPageProvider(service, category_factory,
+ physical_web_data_source);
}
#endif // OS_ANDROID
« no previous file with comments | « no previous file | components/ntp_snippets/BUILD.gn » ('j') | components/ntp_snippets/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698