OLD | NEW |
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_service_factory.h" | 5 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } | 149 } |
150 #endif // OS_ANDROID | 150 #endif // OS_ANDROID |
151 | 151 |
152 // Create the BookmarkSuggestionsProvider. | 152 // Create the BookmarkSuggestionsProvider. |
153 if (base::FeatureList::IsEnabled( | 153 if (base::FeatureList::IsEnabled( |
154 ntp_snippets::kBookmarkSuggestionsFeature)) { | 154 ntp_snippets::kBookmarkSuggestionsFeature)) { |
155 BookmarkModel* bookmark_model = | 155 BookmarkModel* bookmark_model = |
156 BookmarkModelFactory::GetForBrowserContext(profile); | 156 BookmarkModelFactory::GetForBrowserContext(profile); |
157 std::unique_ptr<BookmarkSuggestionsProvider> bookmark_suggestions_provider = | 157 std::unique_ptr<BookmarkSuggestionsProvider> bookmark_suggestions_provider = |
158 base::MakeUnique<BookmarkSuggestionsProvider>( | 158 base::MakeUnique<BookmarkSuggestionsProvider>( |
159 service, service->category_factory(), bookmark_model); | 159 service, service->category_factory(), bookmark_model, |
| 160 profile->GetPrefs()); |
160 service->RegisterProvider(std::move(bookmark_suggestions_provider)); | 161 service->RegisterProvider(std::move(bookmark_suggestions_provider)); |
161 } | 162 } |
162 | 163 |
163 #if defined(OS_ANDROID) | 164 #if defined(OS_ANDROID) |
164 // Create the PhysicalWebPageSuggestionsProvider. | 165 // Create the PhysicalWebPageSuggestionsProvider. |
165 if (base::FeatureList::IsEnabled( | 166 if (base::FeatureList::IsEnabled( |
166 ntp_snippets::kPhysicalWebPageSuggestionsFeature)) { | 167 ntp_snippets::kPhysicalWebPageSuggestionsFeature)) { |
167 std::unique_ptr<PhysicalWebPageSuggestionsProvider> | 168 std::unique_ptr<PhysicalWebPageSuggestionsProvider> |
168 physical_web_page_suggestions_provider = | 169 physical_web_page_suggestions_provider = |
169 base::MakeUnique<PhysicalWebPageSuggestionsProvider>( | 170 base::MakeUnique<PhysicalWebPageSuggestionsProvider>( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 base::MakeUnique<ImageDecoderImpl>(), | 212 base::MakeUnique<ImageDecoderImpl>(), |
212 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner), | 213 base::MakeUnique<NTPSnippetsDatabase>(database_dir, task_runner), |
213 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, | 214 base::MakeUnique<NTPSnippetsStatusService>(signin_manager, |
214 profile->GetPrefs())); | 215 profile->GetPrefs())); |
215 service->set_ntp_snippets_service(ntp_snippets_service.get()); | 216 service->set_ntp_snippets_service(ntp_snippets_service.get()); |
216 service->RegisterProvider(std::move(ntp_snippets_service)); | 217 service->RegisterProvider(std::move(ntp_snippets_service)); |
217 } | 218 } |
218 | 219 |
219 return service; | 220 return service; |
220 } | 221 } |
OLD | NEW |