Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_classifier_factory.cc

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autocomplete/autocomplete_classifier_factory.h" 5 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
6 6
7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
8 #include "chrome/browser/extensions/extension_system_factory.h" 8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/history/shortcuts_backend_factory.h" 9 #include "chrome/browser/history/shortcuts_backend_factory.h"
10 #include "chrome/browser/profiles/incognito_helpers.h" 10 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/search_engines/template_url_service_factory.h" 12 #include "chrome/browser/search_engines/template_url_service_factory.h"
13 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h" 13 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
14 14
15 15
16 // static 16 // static
17 AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( 17 AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile(
18 Profile* profile) { 18 Profile* profile) {
19 return static_cast<AutocompleteClassifier*>( 19 return static_cast<AutocompleteClassifier*>(
20 GetInstance()->GetServiceForProfile(profile, true)); 20 GetInstance()->GetServiceForBrowserContext(profile, true));
21 } 21 }
22 22
23 // static 23 // static
24 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { 24 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() {
25 return Singleton<AutocompleteClassifierFactory>::get(); 25 return Singleton<AutocompleteClassifierFactory>::get();
26 } 26 }
27 27
28 // static 28 // static
29 ProfileKeyedService* AutocompleteClassifierFactory::BuildInstanceFor( 29 BrowserContextKeyedService* AutocompleteClassifierFactory::BuildInstanceFor(
30 content::BrowserContext* profile) { 30 content::BrowserContext* profile) {
31 return new AutocompleteClassifier(static_cast<Profile*>(profile)); 31 return new AutocompleteClassifier(static_cast<Profile*>(profile));
32 } 32 }
33 33
34 AutocompleteClassifierFactory::AutocompleteClassifierFactory() 34 AutocompleteClassifierFactory::AutocompleteClassifierFactory()
35 : ProfileKeyedServiceFactory("AutocompleteClassifier", 35 : BrowserContextKeyedServiceFactory(
36 ProfileDependencyManager::GetInstance()) { 36 "AutocompleteClassifier",
37 BrowserContextDependencyManager::GetInstance()) {
37 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); 38 DependsOn(extensions::ExtensionSystemFactory::GetInstance());
38 DependsOn(TemplateURLServiceFactory::GetInstance()); 39 DependsOn(TemplateURLServiceFactory::GetInstance());
39 // TODO(pkasting): Uncomment these once they exist. 40 // TODO(pkasting): Uncomment these once they exist.
40 // DependsOn(PrefServiceFactory::GetInstance()); 41 // DependsOn(PrefServiceFactory::GetInstance());
41 DependsOn(ShortcutsBackendFactory::GetInstance()); 42 DependsOn(ShortcutsBackendFactory::GetInstance());
42 } 43 }
43 44
44 AutocompleteClassifierFactory::~AutocompleteClassifierFactory() { 45 AutocompleteClassifierFactory::~AutocompleteClassifierFactory() {
45 } 46 }
46 47
47 content::BrowserContext* AutocompleteClassifierFactory::GetBrowserContextToUse( 48 content::BrowserContext* AutocompleteClassifierFactory::GetBrowserContextToUse(
48 content::BrowserContext* context) const { 49 content::BrowserContext* context) const {
49 return chrome::GetBrowserContextRedirectedInIncognito(context); 50 return chrome::GetBrowserContextRedirectedInIncognito(context);
50 } 51 }
51 52
52 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { 53 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const {
53 return true; 54 return true;
54 } 55 }
55 56
56 ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( 57 BrowserContextKeyedService*
58 AutocompleteClassifierFactory::BuildServiceInstanceFor(
57 content::BrowserContext* profile) const { 59 content::BrowserContext* profile) const {
58 return BuildInstanceFor(static_cast<Profile*>(profile)); 60 return BuildInstanceFor(static_cast<Profile*>(profile));
59 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698