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

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: 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
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 dc6c99b668698de70590faa981feadbb4f01fabc..e6967799ee6e30138546efdae6fbd5131f5193e2 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -42,11 +42,13 @@
#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 offline_pages::OfflinePageModel;
using offline_pages::OfflinePageModelFactory;
+using ntp_snippets::PhysicalWebPageSuggestionsProvider;
tschumann 2016/08/09 15:24:59 please sort in alphabetically (after ntp_snippets:
vitaliii 2016/08/10 14:18:40 Done.
#endif // OS_ANDROID
using content::BrowserThread;
@@ -119,6 +121,18 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
}
#endif // OS_ANDROID
+// Create the PhysicalWebPageSuggestionsProvider.
+#if defined(OS_ANDROID)
+ if (base::FeatureList::IsEnabled(
+ chrome::android::kNTPPhysicalWebPageSuggestionsFeature)) {
+ 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
+
// Create the NTPSnippetsService (articles provider).
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);

Powered by Google App Engine
This is Rietveld 408576698