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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
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/chrome_autocomplete_provider_client.h" 7 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
8 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 8 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
9 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" 9 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
10 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" 10 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
(...skipping 11 matching lines...) Expand all
22 22
23 // static 23 // static
24 AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( 24 AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile(
25 Profile* profile) { 25 Profile* profile) {
26 return static_cast<AutocompleteClassifier*>( 26 return static_cast<AutocompleteClassifier*>(
27 GetInstance()->GetServiceForBrowserContext(profile, true)); 27 GetInstance()->GetServiceForBrowserContext(profile, true));
28 } 28 }
29 29
30 // static 30 // static
31 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { 31 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() {
32 return Singleton<AutocompleteClassifierFactory>::get(); 32 return base::Singleton<AutocompleteClassifierFactory>::get();
33 } 33 }
34 34
35 // static 35 // static
36 scoped_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor( 36 scoped_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor(
37 content::BrowserContext* context) { 37 content::BrowserContext* context) {
38 Profile* profile = static_cast<Profile*>(context); 38 Profile* profile = static_cast<Profile*>(context);
39 return make_scoped_ptr(new AutocompleteClassifier( 39 return make_scoped_ptr(new AutocompleteClassifier(
40 make_scoped_ptr(new AutocompleteController( 40 make_scoped_ptr(new AutocompleteController(
41 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)), NULL, 41 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)), NULL,
42 AutocompleteClassifier::kDefaultOmniboxProviders)), 42 AutocompleteClassifier::kDefaultOmniboxProviders)),
(...skipping 25 matching lines...) Expand all
68 } 68 }
69 69
70 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { 70 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const {
71 return true; 71 return true;
72 } 72 }
73 73
74 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( 74 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor(
75 content::BrowserContext* profile) const { 75 content::BrowserContext* profile) const {
76 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); 76 return BuildInstanceFor(static_cast<Profile*>(profile)).release();
77 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698