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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 new BlacklistStore(the_profile->GetPrefs())); | 67 new BlacklistStore(the_profile->GetPrefs())); |
68 | 68 |
69 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData> > db( | 69 scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ImageData> > db( |
70 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner)); | 70 new leveldb_proto::ProtoDatabaseImpl<ImageData>(background_task_runner)); |
71 | 71 |
72 base::FilePath database_dir( | 72 base::FilePath database_dir( |
73 the_profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails"))); | 73 the_profile->GetPath().Append(FILE_PATH_LITERAL("Thumbnails"))); |
74 | 74 |
75 scoped_ptr<ImageFetcherImpl> image_fetcher( | 75 scoped_ptr<ImageFetcherImpl> image_fetcher( |
76 new ImageFetcherImpl(the_profile->GetRequestContext())); | 76 new ImageFetcherImpl(the_profile->GetRequestContext())); |
77 scoped_ptr<ImageManager> thumbnail_manager(new ImageManager( | 77 scoped_ptr<ImageManager> thumbnail_manager( |
78 image_fetcher.PassAs<ImageFetcher>(), | 78 new ImageManager(image_fetcher.Pass(), db.Pass(), database_dir)); |
79 db.PassAs<leveldb_proto::ProtoDatabase<ImageData> >(), database_dir)); | |
80 return new SuggestionsService( | 79 return new SuggestionsService( |
81 the_profile->GetRequestContext(), suggestions_store.Pass(), | 80 the_profile->GetRequestContext(), suggestions_store.Pass(), |
82 thumbnail_manager.Pass(), blacklist_store.Pass()); | 81 thumbnail_manager.Pass(), blacklist_store.Pass()); |
83 } | 82 } |
84 | 83 |
85 void SuggestionsServiceFactory::RegisterProfilePrefs( | 84 void SuggestionsServiceFactory::RegisterProfilePrefs( |
86 user_prefs::PrefRegistrySyncable* registry) { | 85 user_prefs::PrefRegistrySyncable* registry) { |
87 SuggestionsService::RegisterProfilePrefs(registry); | 86 SuggestionsService::RegisterProfilePrefs(registry); |
88 } | 87 } |
89 | 88 |
90 } // namespace suggestions | 89 } // namespace suggestions |
OLD | NEW |