| Index: chrome/browser/search/suggestions/suggestions_service_factory.cc
|
| diff --git a/chrome/browser/search/suggestions/suggestions_service_factory.cc b/chrome/browser/search/suggestions/suggestions_service_factory.cc
|
| index 5ca5f909edd8972aa713b634ff475cf52336377c..4edfcfa4b84c0caa313cad8a6baaddd7de965ad7 100644
|
| --- a/chrome/browser/search/suggestions/suggestions_service_factory.cc
|
| +++ b/chrome/browser/search/suggestions/suggestions_service_factory.cc
|
| @@ -12,6 +12,8 @@
|
| #include "chrome/browser/search/suggestions/image_fetcher_impl.h"
|
| #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| +#include "chrome/browser/sync/profile_sync_service_factory.h"
|
| +#include "components/browser_sync/browser/profile_sync_service.h"
|
| #include "components/keyed_service/content/browser_context_dependency_manager.h"
|
| #include "components/leveldb_proto/proto_database.h"
|
| #include "components/leveldb_proto/proto_database_impl.h"
|
| @@ -49,42 +51,45 @@ SuggestionsServiceFactory::SuggestionsServiceFactory()
|
| BrowserContextDependencyManager::GetInstance()) {
|
| DependsOn(SigninManagerFactory::GetInstance());
|
| DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
|
| + DependsOn(ProfileSyncServiceFactory::GetInstance());
|
| }
|
|
|
| SuggestionsServiceFactory::~SuggestionsServiceFactory() {}
|
|
|
| KeyedService* SuggestionsServiceFactory::BuildServiceInstanceFor(
|
| - content::BrowserContext* profile) const {
|
| + content::BrowserContext* context) const {
|
| scoped_refptr<base::SequencedTaskRunner> background_task_runner =
|
| BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
|
| base::SequencedWorkerPool::GetSequenceToken());
|
|
|
| - Profile* the_profile = static_cast<Profile*>(profile);
|
| + Profile* profile = static_cast<Profile*>(context);
|
|
|
| SigninManagerBase* signin_manager =
|
| - SigninManagerFactory::GetForProfile(the_profile);
|
| + SigninManagerFactory::GetForProfile(profile);
|
| ProfileOAuth2TokenService* token_service =
|
| - ProfileOAuth2TokenServiceFactory::GetForProfile(the_profile);
|
| + ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
|
| + ProfileSyncService* sync_service =
|
| + ProfileSyncServiceFactory::GetForProfile(profile);
|
|
|
| scoped_ptr<SuggestionsStore> suggestions_store(
|
| - new SuggestionsStore(the_profile->GetPrefs()));
|
| + new SuggestionsStore(profile->GetPrefs()));
|
| scoped_ptr<BlacklistStore> blacklist_store(
|
| - new BlacklistStore(the_profile->GetPrefs()));
|
| + new BlacklistStore(profile->GetPrefs()));
|
|
|
| scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData> > db(
|
| new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner));
|
|
|
| base::FilePath database_dir(
|
| - the_profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails")));
|
| + profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails")));
|
|
|
| scoped_ptr<ImageFetcherImpl> image_fetcher(
|
| - new ImageFetcherImpl(the_profile->GetRequestContext()));
|
| + new ImageFetcherImpl(profile->GetRequestContext()));
|
| scoped_ptr<ImageManager> thumbnail_manager(
|
| new ImageManager(
|
| std::move(image_fetcher), std::move(db), database_dir,
|
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)));
|
| return new SuggestionsService(
|
| - signin_manager, token_service, the_profile->GetRequestContext(),
|
| + signin_manager, token_service, sync_service, profile->GetRequestContext(),
|
| std::move(suggestions_store), std::move(thumbnail_manager),
|
| std::move(blacklist_store));
|
| }
|
|
|