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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/incognito_helpers.h" | 8 #include "chrome/browser/profiles/incognito_helpers.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/suggestions/blacklist_store.h" |
10 #include "chrome/browser/search/suggestions/suggestions_service.h" | 11 #include "chrome/browser/search/suggestions/suggestions_service.h" |
11 #include "chrome/browser/search/suggestions/suggestions_store.h" | 12 #include "chrome/browser/search/suggestions/suggestions_store.h" |
12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
13 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
14 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
15 | 16 |
16 namespace suggestions { | 17 namespace suggestions { |
17 | 18 |
18 // static | 19 // static |
19 SuggestionsService* SuggestionsServiceFactory::GetForProfile(Profile* profile) { | 20 SuggestionsService* SuggestionsServiceFactory::GetForProfile(Profile* profile) { |
(...skipping 22 matching lines...) Expand all Loading... |
42 return chrome::GetBrowserContextRedirectedInIncognito(context); | 43 return chrome::GetBrowserContextRedirectedInIncognito(context); |
43 } | 44 } |
44 | 45 |
45 KeyedService* SuggestionsServiceFactory::BuildServiceInstanceFor( | 46 KeyedService* SuggestionsServiceFactory::BuildServiceInstanceFor( |
46 content::BrowserContext* profile) const { | 47 content::BrowserContext* profile) const { |
47 Profile* the_profile = static_cast<Profile*>(profile); | 48 Profile* the_profile = static_cast<Profile*>(profile); |
48 scoped_ptr<SuggestionsStore> suggestions_store( | 49 scoped_ptr<SuggestionsStore> suggestions_store( |
49 new SuggestionsStore(the_profile->GetPrefs())); | 50 new SuggestionsStore(the_profile->GetPrefs())); |
50 scoped_ptr<ThumbnailManager> thumbnail_manager( | 51 scoped_ptr<ThumbnailManager> thumbnail_manager( |
51 new ThumbnailManager(the_profile->GetRequestContext())); | 52 new ThumbnailManager(the_profile->GetRequestContext())); |
| 53 scoped_ptr<BlacklistStore> blacklist_store( |
| 54 new BlacklistStore(the_profile->GetPrefs())); |
52 return new SuggestionsService(the_profile, suggestions_store.Pass(), | 55 return new SuggestionsService(the_profile, suggestions_store.Pass(), |
53 thumbnail_manager.Pass()); | 56 thumbnail_manager.Pass(), |
| 57 blacklist_store.Pass()); |
54 } | 58 } |
55 | 59 |
56 void SuggestionsServiceFactory::RegisterProfilePrefs( | 60 void SuggestionsServiceFactory::RegisterProfilePrefs( |
57 user_prefs::PrefRegistrySyncable* registry) { | 61 user_prefs::PrefRegistrySyncable* registry) { |
58 SuggestionsService::RegisterProfilePrefs(registry); | 62 SuggestionsService::RegisterProfilePrefs(registry); |
59 } | 63 } |
60 | 64 |
61 } // namespace suggestions | 65 } // namespace suggestions |
OLD | NEW |