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

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

Issue 2228553003: a provider of Physical Web pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolved compile error. Created 4 years, 4 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/about_flags.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 afa227d04c5fe2cf767d77e84fd65eee56f5f3ce..a2303ce83f9d5ecff08e298adbb183bf05a82251 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -45,9 +45,11 @@
#include "chrome/browser/android/ntp/ntp_snippets_launcher.h"
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
#include "components/ntp_snippets/offline_pages/offline_page_suggestions_provider.h"
+#include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h"
#include "components/offline_pages/offline_page_model.h"
using ntp_snippets::OfflinePageSuggestionsProvider;
+using ntp_snippets::PhysicalWebPageSuggestionsProvider;
using offline_pages::OfflinePageModel;
using offline_pages::OfflinePageModelFactory;
#endif // OS_ANDROID
@@ -158,6 +160,19 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
service->RegisterProvider(std::move(bookmark_suggestions_provider));
}
+#if defined(OS_ANDROID)
+ // Create the PhysicalWebPageSuggestionsProvider.
+ if (base::FeatureList::IsEnabled(
+ ntp_snippets::kPhysicalWebPageSuggestionsFeature)) {
+ std::unique_ptr<PhysicalWebPageSuggestionsProvider>
+ physical_web_page_suggestions_provider =
+ base::MakeUnique<PhysicalWebPageSuggestionsProvider>(
+ service, service->category_factory());
+ service->RegisterProvider(
+ std::move(physical_web_page_suggestions_provider));
+ }
+#endif // OS_ANDROID
+
if (base::FeatureList::IsEnabled(ntp_snippets::kArticleSuggestionsFeature)) {
// Create the NTPSnippetsService (articles provider).
SigninManagerBase* signin_manager =
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698