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

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

Issue 2831553003: List our features in ntp_snippets::kAllFeatures (Closed)
Patch Set: rebase Created 3 years, 7 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 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_notifier_service_facto ry.h" 5 #include "chrome/browser/ntp_snippets/content_suggestions_notifier_service_facto ry.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" 9 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h"
10 #include "chrome/browser/ntp_snippets/ntp_snippets_features.h"
11 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
12 #include "components/keyed_service/content/browser_context_dependency_manager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "components/ntp_snippets/features.h"
13 #include "components/variations/variations_associated_data.h" 13 #include "components/variations/variations_associated_data.h"
14 14
15 #if defined(OS_ANDROID) 15 #if defined(OS_ANDROID)
16 #include "chrome/browser/android/ntp/content_suggestions_notifier_service.h" 16 #include "chrome/browser/android/ntp/content_suggestions_notifier_service.h"
17 #endif 17 #endif
18 18
19 using params::ntp_snippets::kNotificationsFeature; 19 using ntp_snippets::kNotificationsFeature;
20 20
21 ContentSuggestionsNotifierServiceFactory* 21 ContentSuggestionsNotifierServiceFactory*
22 ContentSuggestionsNotifierServiceFactory::GetInstance() { 22 ContentSuggestionsNotifierServiceFactory::GetInstance() {
23 return base::Singleton<ContentSuggestionsNotifierServiceFactory>::get(); 23 return base::Singleton<ContentSuggestionsNotifierServiceFactory>::get();
24 } 24 }
25 25
26 ContentSuggestionsNotifierService* 26 ContentSuggestionsNotifierService*
27 ContentSuggestionsNotifierServiceFactory::GetForProfile(Profile* profile) { 27 ContentSuggestionsNotifierServiceFactory::GetForProfile(Profile* profile) {
28 #if defined(OS_ANDROID) 28 #if defined(OS_ANDROID)
29 return static_cast<ContentSuggestionsNotifierService*>( 29 return static_cast<ContentSuggestionsNotifierService*>(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #if defined(OS_ANDROID) 61 #if defined(OS_ANDROID)
62 if (base::FeatureList::IsEnabled(kNotificationsFeature)) { 62 if (base::FeatureList::IsEnabled(kNotificationsFeature)) {
63 Profile* profile = Profile::FromBrowserContext(context); 63 Profile* profile = Profile::FromBrowserContext(context);
64 ntp_snippets::ContentSuggestionsService* suggestions = 64 ntp_snippets::ContentSuggestionsService* suggestions =
65 ContentSuggestionsServiceFactory::GetForProfile(profile); 65 ContentSuggestionsServiceFactory::GetForProfile(profile);
66 return new ContentSuggestionsNotifierService(profile, suggestions); 66 return new ContentSuggestionsNotifierService(profile, suggestions);
67 } 67 }
68 #endif 68 #endif
69 return nullptr; 69 return nullptr;
70 } 70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698