OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/chrome/browser/suggestions/suggestions_service_factory.h" | 5 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
13 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
14 #include "components/browser_sync/profile_sync_service.h" | 14 #include "components/browser_sync/profile_sync_service.h" |
15 #include "components/image_fetcher/image_fetcher.h" | 15 #include "components/image_fetcher/image_fetcher.h" |
16 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 16 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
17 #include "components/leveldb_proto/proto_database_impl.h" | 17 #include "components/leveldb_proto/proto_database_impl.h" |
18 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 18 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
19 #include "components/signin/core/browser/signin_manager.h" | 19 #include "components/signin/core/browser/signin_manager.h" |
20 #include "components/suggestions/blacklist_store.h" | 20 #include "components/suggestions/blacklist_store.h" |
21 #include "components/suggestions/image_manager.h" | 21 #include "components/suggestions/image_manager.h" |
22 #include "components/suggestions/suggestions_service.h" | 22 #include "components/suggestions/suggestions_service_impl.h" |
23 #include "components/suggestions/suggestions_store.h" | 23 #include "components/suggestions/suggestions_store.h" |
24 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 24 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
25 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" | 25 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" |
26 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 26 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
27 #include "ios/chrome/browser/suggestions/image_fetcher_impl.h" | 27 #include "ios/chrome/browser/suggestions/image_fetcher_impl.h" |
28 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" | 28 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" |
29 #include "ios/web/public/browser_state.h" | 29 #include "ios/web/public/browser_state.h" |
30 #include "ios/web/public/web_thread.h" | 30 #include "ios/web/public/web_thread.h" |
31 | 31 |
32 namespace suggestions { | 32 namespace suggestions { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 std::unique_ptr<BlacklistStore> blacklist_store( | 83 std::unique_ptr<BlacklistStore> blacklist_store( |
84 new BlacklistStore(browser_state->GetPrefs())); | 84 new BlacklistStore(browser_state->GetPrefs())); |
85 std::unique_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData>> db( | 85 std::unique_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData>> db( |
86 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner)); | 86 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner)); |
87 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher( | 87 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher( |
88 new ImageFetcherImpl(browser_state->GetRequestContext(), | 88 new ImageFetcherImpl(browser_state->GetRequestContext(), |
89 sequenced_worker_pool)); | 89 sequenced_worker_pool)); |
90 std::unique_ptr<ImageManager> thumbnail_manager(new ImageManager( | 90 std::unique_ptr<ImageManager> thumbnail_manager(new ImageManager( |
91 std::move(image_fetcher), std::move(db), database_dir, | 91 std::move(image_fetcher), std::move(db), database_dir, |
92 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB))); | 92 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB))); |
93 return base::MakeUnique<SuggestionsService>( | 93 return base::MakeUnique<SuggestionsServiceImpl>( |
94 signin_manager, token_service, sync_service, | 94 signin_manager, token_service, sync_service, |
95 browser_state->GetRequestContext(), std::move(suggestions_store), | 95 browser_state->GetRequestContext(), std::move(suggestions_store), |
96 std::move(thumbnail_manager), std::move(blacklist_store)); | 96 std::move(thumbnail_manager), std::move(blacklist_store)); |
97 } | 97 } |
98 | 98 |
99 void SuggestionsServiceFactory::RegisterBrowserStatePrefs( | 99 void SuggestionsServiceFactory::RegisterBrowserStatePrefs( |
100 user_prefs::PrefRegistrySyncable* registry) { | 100 user_prefs::PrefRegistrySyncable* registry) { |
101 SuggestionsService::RegisterProfilePrefs(registry); | 101 SuggestionsServiceImpl::RegisterProfilePrefs(registry); |
102 } | 102 } |
103 | 103 |
104 } // namespace suggestions | 104 } // namespace suggestions |
OLD | NEW |