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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "content/public/browser/browser_thread.h" | 56 #include "content/public/browser/browser_thread.h" |
57 #include "content/public/browser/storage_partition.h" | 57 #include "content/public/browser/storage_partition.h" |
58 #include "google_apis/google_api_keys.h" | 58 #include "google_apis/google_api_keys.h" |
59 #include "net/url_request/url_request_context_getter.h" | 59 #include "net/url_request/url_request_context_getter.h" |
60 | 60 |
61 #if defined(OS_ANDROID) | 61 #if defined(OS_ANDROID) |
62 #include "chrome/browser/android/chrome_feature_list.h" | 62 #include "chrome/browser/android/chrome_feature_list.h" |
63 #include "chrome/browser/android/ntp/ntp_snippets_launcher.h" | 63 #include "chrome/browser/android/ntp/ntp_snippets_launcher.h" |
64 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" | 64 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
65 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" | 65 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" |
| 66 #include "chrome/browser/download/download_core_service.h" |
| 67 #include "chrome/browser/download/download_core_service_factory.h" |
66 #include "chrome/browser/download/download_history.h" | 68 #include "chrome/browser/download/download_history.h" |
67 #include "chrome/browser/download/download_service.h" | |
68 #include "chrome/browser/download/download_service_factory.h" | |
69 #include "chrome/browser/ntp_snippets/download_suggestions_provider.h" | 69 #include "chrome/browser/ntp_snippets/download_suggestions_provider.h" |
70 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.
h" | 70 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.
h" |
71 #include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestio
ns_provider.h" | 71 #include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestio
ns_provider.h" |
72 #include "components/offline_pages/content/suggested_articles_observer.h" | 72 #include "components/offline_pages/content/suggested_articles_observer.h" |
73 #include "components/offline_pages/core/background/request_coordinator.h" | 73 #include "components/offline_pages/core/background/request_coordinator.h" |
74 #include "components/offline_pages/core/offline_page_feature.h" | 74 #include "components/offline_pages/core/offline_page_feature.h" |
75 #include "components/offline_pages/core/offline_page_model.h" | 75 #include "components/offline_pages/core/offline_page_model.h" |
76 #include "components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_deleg
ate.h" | 76 #include "components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_deleg
ate.h" |
77 #include "components/physical_web/data_source/physical_web_data_source.h" | 77 #include "components/physical_web/data_source/physical_web_data_source.h" |
78 | 78 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 pref_service, std::move(category_ranker), std::move(user_classifier), | 335 pref_service, std::move(category_ranker), std::move(user_classifier), |
336 std::move(scheduler)); | 336 std::move(scheduler)); |
337 | 337 |
338 #if defined(OS_ANDROID) | 338 #if defined(OS_ANDROID) |
339 OfflinePageModel* offline_page_model = | 339 OfflinePageModel* offline_page_model = |
340 OfflinePageModelFactory::GetForBrowserContext(profile); | 340 OfflinePageModelFactory::GetForBrowserContext(profile); |
341 RequestCoordinator* request_coordinator = | 341 RequestCoordinator* request_coordinator = |
342 RequestCoordinatorFactory::GetForBrowserContext(profile); | 342 RequestCoordinatorFactory::GetForBrowserContext(profile); |
343 DownloadManager* download_manager = | 343 DownloadManager* download_manager = |
344 content::BrowserContext::GetDownloadManager(profile); | 344 content::BrowserContext::GetDownloadManager(profile); |
345 DownloadService* download_service = | 345 DownloadCoreService* download_core_service = |
346 DownloadServiceFactory::GetForBrowserContext(profile); | 346 DownloadCoreServiceFactory::GetForBrowserContext(profile); |
347 DownloadHistory* download_history = download_service->GetDownloadHistory(); | 347 DownloadHistory* download_history = |
| 348 download_core_service->GetDownloadHistory(); |
348 PhysicalWebDataSource* physical_web_data_source = | 349 PhysicalWebDataSource* physical_web_data_source = |
349 g_browser_process->GetPhysicalWebDataSource(); | 350 g_browser_process->GetPhysicalWebDataSource(); |
350 #endif // OS_ANDROID | 351 #endif // OS_ANDROID |
351 BookmarkModel* bookmark_model = | 352 BookmarkModel* bookmark_model = |
352 BookmarkModelFactory::GetForBrowserContext(profile); | 353 BookmarkModelFactory::GetForBrowserContext(profile); |
353 OAuth2TokenService* token_service = | 354 OAuth2TokenService* token_service = |
354 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 355 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
355 SyncService* sync_service = | 356 SyncService* sync_service = |
356 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile); | 357 ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile); |
357 LanguageModel* language_model = | 358 LanguageModel* language_model = |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 ntp_snippets::kForeignSessionsSuggestionsFeature)) { | 405 ntp_snippets::kForeignSessionsSuggestionsFeature)) { |
405 RegisterForeignSessionsProvider(sync_service, service, pref_service); | 406 RegisterForeignSessionsProvider(sync_service, service, pref_service); |
406 } | 407 } |
407 | 408 |
408 return service; | 409 return service; |
409 | 410 |
410 #else | 411 #else |
411 return nullptr; | 412 return nullptr; |
412 #endif // CONTENT_SUGGESTIONS_ENABLED | 413 #endif // CONTENT_SUGGESTIONS_ENABLED |
413 } | 414 } |
OLD | NEW |