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 "chrome/browser/search/suggestions/suggestions_service_factory.h" | 5 #include "chrome/browser/search/suggestions/suggestions_service_factory.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "chrome/browser/profiles/incognito_helpers.h" | 11 #include "chrome/browser/profiles/incognito_helpers.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/search/suggestions/image_decoder_impl.h" | 13 #include "chrome/browser/search/suggestions/image_decoder_impl.h" |
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
15 #include "chrome/browser/signin/signin_manager_factory.h" | 15 #include "chrome/browser/signin/signin_manager_factory.h" |
16 #include "chrome/browser/sync/profile_sync_service_factory.h" | 16 #include "chrome/browser/sync/profile_sync_service_factory.h" |
17 #include "components/browser_sync/profile_sync_service.h" | 17 #include "components/browser_sync/profile_sync_service.h" |
18 #include "components/image_fetcher/image_fetcher.h" | 18 #include "components/image_fetcher/image_fetcher.h" |
19 #include "components/image_fetcher/image_fetcher_impl.h" | 19 #include "components/image_fetcher/image_fetcher_impl.h" |
20 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 20 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
21 #include "components/leveldb_proto/proto_database.h" | 21 #include "components/leveldb_proto/proto_database.h" |
22 #include "components/leveldb_proto/proto_database_impl.h" | 22 #include "components/leveldb_proto/proto_database_impl.h" |
23 #include "components/pref_registry/pref_registry_syncable.h" | 23 #include "components/pref_registry/pref_registry_syncable.h" |
24 #include "components/prefs/pref_service.h" | 24 #include "components/prefs/pref_service.h" |
25 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 25 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
26 #include "components/signin/core/browser/signin_manager.h" | 26 #include "components/signin/core/browser/signin_manager.h" |
27 #include "components/suggestions/blacklist_store.h" | 27 #include "components/suggestions/blacklist_store.h" |
28 #include "components/suggestions/image_manager.h" | 28 #include "components/suggestions/image_manager.h" |
29 #include "components/suggestions/proto/suggestions.pb.h" | 29 #include "components/suggestions/proto/suggestions.pb.h" |
30 #include "components/suggestions/suggestions_service.h" | 30 #include "components/suggestions/suggestions_service_impl.h" |
31 #include "components/suggestions/suggestions_store.h" | 31 #include "components/suggestions/suggestions_store.h" |
32 #include "content/public/browser/browser_context.h" | 32 #include "content/public/browser/browser_context.h" |
33 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
34 | 34 |
35 using content::BrowserThread; | 35 using content::BrowserThread; |
36 using image_fetcher::ImageFetcherImpl; | 36 using image_fetcher::ImageFetcherImpl; |
37 | 37 |
38 namespace suggestions { | 38 namespace suggestions { |
39 | 39 |
40 // static | 40 // static |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 base::FilePath database_dir( | 85 base::FilePath database_dir( |
86 profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails"))); | 86 profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails"))); |
87 | 87 |
88 std::unique_ptr<ImageFetcherImpl> image_fetcher( | 88 std::unique_ptr<ImageFetcherImpl> image_fetcher( |
89 new ImageFetcherImpl( | 89 new ImageFetcherImpl( |
90 base::MakeUnique<suggestions::ImageDecoderImpl>(), | 90 base::MakeUnique<suggestions::ImageDecoderImpl>(), |
91 profile->GetRequestContext())); | 91 profile->GetRequestContext())); |
92 std::unique_ptr<ImageManager> thumbnail_manager(new ImageManager( | 92 std::unique_ptr<ImageManager> thumbnail_manager(new ImageManager( |
93 std::move(image_fetcher), std::move(db), database_dir, | 93 std::move(image_fetcher), std::move(db), database_dir, |
94 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB))); | 94 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB))); |
95 return new SuggestionsService( | 95 return new SuggestionsServiceImpl( |
96 signin_manager, token_service, sync_service, profile->GetRequestContext(), | 96 signin_manager, token_service, sync_service, profile->GetRequestContext(), |
97 std::move(suggestions_store), std::move(thumbnail_manager), | 97 std::move(suggestions_store), std::move(thumbnail_manager), |
98 std::move(blacklist_store)); | 98 std::move(blacklist_store)); |
99 } | 99 } |
100 | 100 |
101 void SuggestionsServiceFactory::RegisterProfilePrefs( | 101 void SuggestionsServiceFactory::RegisterProfilePrefs( |
102 user_prefs::PrefRegistrySyncable* registry) { | 102 user_prefs::PrefRegistrySyncable* registry) { |
103 SuggestionsService::RegisterProfilePrefs(registry); | 103 SuggestionsServiceImpl::RegisterProfilePrefs(registry); |
104 } | 104 } |
105 | 105 |
106 } // namespace suggestions | 106 } // namespace suggestions |
OLD | NEW |