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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 // Create the ContentSuggestionsService. | 289 // Create the ContentSuggestionsService. |
290 SigninManagerBase* signin_manager = | 290 SigninManagerBase* signin_manager = |
291 SigninManagerFactory::GetForProfile(profile); | 291 SigninManagerFactory::GetForProfile(profile); |
292 HistoryService* history_service = HistoryServiceFactory::GetForProfile( | 292 HistoryService* history_service = HistoryServiceFactory::GetForProfile( |
293 profile, ServiceAccessType::EXPLICIT_ACCESS); | 293 profile, ServiceAccessType::EXPLICIT_ACCESS); |
294 PrefService* pref_service = profile->GetPrefs(); | 294 PrefService* pref_service = profile->GetPrefs(); |
295 std::unique_ptr<CategoryRanker> category_ranker = | 295 std::unique_ptr<CategoryRanker> category_ranker = |
296 ntp_snippets::BuildSelectedCategoryRanker( | 296 ntp_snippets::BuildSelectedCategoryRanker( |
297 pref_service, base::MakeUnique<base::DefaultClock>()); | 297 pref_service, base::MakeUnique<base::DefaultClock>()); |
298 auto* service = | 298 auto* service = new ContentSuggestionsService(State::ENABLED, signin_manager, |
299 new ContentSuggestionsService(State::ENABLED, signin_manager, | 299 history_service, pref_service, |
300 history_service, pref_service, std::move(category_ranker)); | 300 std::move(category_ranker)); |
301 | 301 |
302 #if defined(OS_ANDROID) | 302 #if defined(OS_ANDROID) |
303 OfflinePageModel* offline_page_model = | 303 OfflinePageModel* offline_page_model = |
304 OfflinePageModelFactory::GetForBrowserContext(profile); | 304 OfflinePageModelFactory::GetForBrowserContext(profile); |
305 RequestCoordinator* request_coordinator = | 305 RequestCoordinator* request_coordinator = |
306 RequestCoordinatorFactory::GetForBrowserContext(profile); | 306 RequestCoordinatorFactory::GetForBrowserContext(profile); |
307 DownloadManager* download_manager = | 307 DownloadManager* download_manager = |
308 content::BrowserContext::GetDownloadManager(profile); | 308 content::BrowserContext::GetDownloadManager(profile); |
309 DownloadService* download_service = | 309 DownloadService* download_service = |
310 DownloadServiceFactory::GetForBrowserContext(profile); | 310 DownloadServiceFactory::GetForBrowserContext(profile); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ntp_snippets::kForeignSessionsSuggestionsFeature)) { | 361 ntp_snippets::kForeignSessionsSuggestionsFeature)) { |
362 RegisterForeignSessionsProvider(sync_service, service, pref_service); | 362 RegisterForeignSessionsProvider(sync_service, service, pref_service); |
363 } | 363 } |
364 | 364 |
365 return service; | 365 return service; |
366 | 366 |
367 #else | 367 #else |
368 return nullptr; | 368 return nullptr; |
369 #endif // CONTENT_SUGGESTIONS_ENABLED | 369 #endif // CONTENT_SUGGESTIONS_ENABLED |
370 } | 370 } |
OLD | NEW |