| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |