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

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

Issue 354773002: Reduces dependency from AutocompleteMatch to Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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/autocomplete/autocomplete_controller.h" 8 #include "chrome/browser/autocomplete/autocomplete_controller.h"
9 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 9 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
10 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" 10 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
(...skipping 15 matching lines...) Expand all
26 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { 26 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() {
27 return Singleton<AutocompleteClassifierFactory>::get(); 27 return Singleton<AutocompleteClassifierFactory>::get();
28 } 28 }
29 29
30 // static 30 // static
31 KeyedService* AutocompleteClassifierFactory::BuildInstanceFor( 31 KeyedService* AutocompleteClassifierFactory::BuildInstanceFor(
32 content::BrowserContext* context) { 32 content::BrowserContext* context) {
33 Profile* profile = static_cast<Profile*>(context); 33 Profile* profile = static_cast<Profile*>(context);
34 return new AutocompleteClassifier( 34 return new AutocompleteClassifier(
35 make_scoped_ptr(new AutocompleteController( 35 make_scoped_ptr(new AutocompleteController(
36 profile, NULL, AutocompleteClassifier::kDefaultOmniboxProviders)), 36 profile, TemplateURLServiceFactory::GetForProfile(profile), NULL,
37 AutocompleteClassifier::kDefaultOmniboxProviders)),
37 scoped_ptr<AutocompleteSchemeClassifier>( 38 scoped_ptr<AutocompleteSchemeClassifier>(
38 new ChromeAutocompleteSchemeClassifier(profile))); 39 new ChromeAutocompleteSchemeClassifier(profile)));
39 } 40 }
40 41
41 AutocompleteClassifierFactory::AutocompleteClassifierFactory() 42 AutocompleteClassifierFactory::AutocompleteClassifierFactory()
42 : BrowserContextKeyedServiceFactory( 43 : BrowserContextKeyedServiceFactory(
43 "AutocompleteClassifier", 44 "AutocompleteClassifier",
44 BrowserContextDependencyManager::GetInstance()) { 45 BrowserContextDependencyManager::GetInstance()) {
45 DependsOn( 46 DependsOn(
46 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 47 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
(...skipping 12 matching lines...) Expand all
59 } 60 }
60 61
61 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { 62 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const {
62 return true; 63 return true;
63 } 64 }
64 65
65 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( 66 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor(
66 content::BrowserContext* profile) const { 67 content::BrowserContext* profile) const {
67 return BuildInstanceFor(static_cast<Profile*>(profile)); 68 return BuildInstanceFor(static_cast<Profile*>(profile));
68 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698