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

Side by Side Diff: ios/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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/chrome/browser/autocomplete/autocomplete_classifier_factory.h" 5 #include "ios/chrome/browser/autocomplete/autocomplete_classifier_factory.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "components/keyed_service/ios/browser_state_dependency_manager.h" 8 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
9 #include "components/omnibox/browser/autocomplete_classifier.h" 9 #include "components/omnibox/browser/autocomplete_classifier.h"
10 #include "components/omnibox/browser/autocomplete_controller.h" 10 #include "components/omnibox/browser/autocomplete_controller.h"
(...skipping 23 matching lines...) Expand all
34 34
35 // static 35 // static
36 AutocompleteClassifier* AutocompleteClassifierFactory::GetForBrowserState( 36 AutocompleteClassifier* AutocompleteClassifierFactory::GetForBrowserState(
37 ios::ChromeBrowserState* browser_state) { 37 ios::ChromeBrowserState* browser_state) {
38 return static_cast<AutocompleteClassifier*>( 38 return static_cast<AutocompleteClassifier*>(
39 GetInstance()->GetServiceForBrowserState(browser_state, true)); 39 GetInstance()->GetServiceForBrowserState(browser_state, true));
40 } 40 }
41 41
42 // static 42 // static
43 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { 43 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() {
44 return Singleton<AutocompleteClassifierFactory>::get(); 44 return base::Singleton<AutocompleteClassifierFactory>::get();
45 } 45 }
46 46
47 // static 47 // static
48 BrowserStateKeyedServiceFactory::TestingFactoryFunction 48 BrowserStateKeyedServiceFactory::TestingFactoryFunction
49 AutocompleteClassifierFactory::GetDefaultFactory() { 49 AutocompleteClassifierFactory::GetDefaultFactory() {
50 return &BuildAutocompleteClassifier; 50 return &BuildAutocompleteClassifier;
51 } 51 }
52 52
53 AutocompleteClassifierFactory::AutocompleteClassifierFactory() 53 AutocompleteClassifierFactory::AutocompleteClassifierFactory()
54 : BrowserStateKeyedServiceFactory( 54 : BrowserStateKeyedServiceFactory(
(...skipping 14 matching lines...) Expand all
69 web::BrowserState* AutocompleteClassifierFactory::GetBrowserStateToUse( 69 web::BrowserState* AutocompleteClassifierFactory::GetBrowserStateToUse(
70 web::BrowserState* context) const { 70 web::BrowserState* context) const {
71 return GetBrowserStateRedirectedInIncognito(context); 71 return GetBrowserStateRedirectedInIncognito(context);
72 } 72 }
73 73
74 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { 74 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const {
75 return true; 75 return true;
76 } 76 }
77 77
78 } // namespace ios 78 } // namespace ios
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698