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

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: added unittest 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 effac326b78c72d3debba7538b79e1dd62ee842e..334dd44e17ec18bbc8771cc2cf2fca899142d11c 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
@@ -147,6 +149,20 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
SuggestionsService* suggestions_service =
SuggestionsServiceFactory::GetForProfile(profile);
NTPSnippetsScheduler* scheduler = nullptr;
+
+#if defined(OS_ANDROID)
Marc Treib 2016/08/10 16:22:03 This block is in the wrong place: It's inside the
tschumann 2016/08/10 17:37:57 not really related to this CL, but as we are here.
Marc Treib 2016/08/11 12:15:24 Yep, this sounds like a good idea. Doesn't need to
vitaliii 2016/08/11 12:15:24 Done.
vitaliii 2016/08/11 12:15:24 Acknowledged.
+ // Create the PhysicalWebPageSuggestionsProvider.
+ 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
+
#if defined(OS_ANDROID)
scheduler = NTPSnippetsLauncher::Get();
#endif // OS_ANDROID

Powered by Google App Engine
This is Rietveld 408576698