OLD | NEW |
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/autocomplete/autocomplete_controller.h" | 8 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 9 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" |
9 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 10 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
10 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" | 11 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" |
11 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" | 12 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" |
12 #include "chrome/browser/profiles/incognito_helpers.h" | 13 #include "chrome/browser/profiles/incognito_helpers.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/search_engines/template_url_service_factory.h" | 15 #include "chrome/browser/search_engines/template_url_service_factory.h" |
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
16 | 17 |
17 #if defined(ENABLE_EXTENSIONS) | 18 #if defined(ENABLE_EXTENSIONS) |
18 #include "extensions/browser/extension_system_provider.h" | 19 #include "extensions/browser/extension_system_provider.h" |
(...skipping 11 matching lines...) Expand all Loading... |
30 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { | 31 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { |
31 return Singleton<AutocompleteClassifierFactory>::get(); | 32 return Singleton<AutocompleteClassifierFactory>::get(); |
32 } | 33 } |
33 | 34 |
34 // static | 35 // static |
35 scoped_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor( | 36 scoped_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor( |
36 content::BrowserContext* context) { | 37 content::BrowserContext* context) { |
37 Profile* profile = static_cast<Profile*>(context); | 38 Profile* profile = static_cast<Profile*>(context); |
38 return make_scoped_ptr(new AutocompleteClassifier( | 39 return make_scoped_ptr(new AutocompleteClassifier( |
39 make_scoped_ptr(new AutocompleteController( | 40 make_scoped_ptr(new AutocompleteController( |
40 profile, TemplateURLServiceFactory::GetForProfile(profile), NULL, | 41 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)), NULL, |
41 AutocompleteClassifier::kDefaultOmniboxProviders)), | 42 AutocompleteClassifier::kDefaultOmniboxProviders)), |
42 scoped_ptr<AutocompleteSchemeClassifier>( | 43 scoped_ptr<AutocompleteSchemeClassifier>( |
43 new ChromeAutocompleteSchemeClassifier(profile)))); | 44 new ChromeAutocompleteSchemeClassifier(profile)))); |
44 } | 45 } |
45 | 46 |
46 AutocompleteClassifierFactory::AutocompleteClassifierFactory() | 47 AutocompleteClassifierFactory::AutocompleteClassifierFactory() |
47 : BrowserContextKeyedServiceFactory( | 48 : BrowserContextKeyedServiceFactory( |
48 "AutocompleteClassifier", | 49 "AutocompleteClassifier", |
49 BrowserContextDependencyManager::GetInstance()) { | 50 BrowserContextDependencyManager::GetInstance()) { |
50 #if defined(ENABLE_EXTENSIONS) | 51 #if defined(ENABLE_EXTENSIONS) |
(...skipping 16 matching lines...) Expand all Loading... |
67 } | 68 } |
68 | 69 |
69 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { | 70 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { |
70 return true; | 71 return true; |
71 } | 72 } |
72 | 73 |
73 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( | 74 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( |
74 content::BrowserContext* profile) const { | 75 content::BrowserContext* profile) const { |
75 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); | 76 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); |
76 } | 77 } |
OLD | NEW |