| 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/predictors/autocomplete_action_predictor_factory.h" | 5 #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 7 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/profiles/profile_dependency_manager.h" | 9 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 10 | 10 |
| 11 namespace predictors { |
| 12 |
| 11 // static | 13 // static |
| 12 AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile( | 14 AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile( |
| 13 Profile* profile) { | 15 Profile* profile) { |
| 14 return static_cast<AutocompleteActionPredictor*>( | 16 return static_cast<AutocompleteActionPredictor*>( |
| 15 GetInstance()->GetServiceForProfile(profile, true)); | 17 GetInstance()->GetServiceForProfile(profile, true)); |
| 16 } | 18 } |
| 17 | 19 |
| 18 // static | 20 // static |
| 19 AutocompleteActionPredictorFactory* | 21 AutocompleteActionPredictorFactory* |
| 20 AutocompleteActionPredictorFactory::GetInstance() { | 22 AutocompleteActionPredictorFactory::GetInstance() { |
| 21 return Singleton<AutocompleteActionPredictorFactory>::get(); | 23 return Singleton<AutocompleteActionPredictorFactory>::get(); |
| 22 } | 24 } |
| 23 | 25 |
| 24 AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory() | 26 AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory() |
| 25 : ProfileKeyedServiceFactory("AutocompleteActionPredictor", | 27 : ProfileKeyedServiceFactory("AutocompleteActionPredictor", |
| 26 ProfileDependencyManager::GetInstance()) { | 28 ProfileDependencyManager::GetInstance()) { |
| 27 // TODO(erg): When HistoryService is PKSFized, uncomment this. | 29 // TODO(erg): When HistoryService is PKSFized, uncomment this. |
| 28 // DependsOn(HistoryServiceFactory::GetInstance()); | 30 // DependsOn(HistoryServiceFactory::GetInstance()); |
| 29 } | 31 } |
| 30 | 32 |
| 31 AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {} | 33 AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {} |
| 32 | 34 |
| 33 ProfileKeyedService* | 35 ProfileKeyedService* |
| 34 AutocompleteActionPredictorFactory::BuildServiceInstanceFor( | 36 AutocompleteActionPredictorFactory::BuildServiceInstanceFor( |
| 35 Profile* profile) const { | 37 Profile* profile) const { |
| 36 return new AutocompleteActionPredictor(profile); | 38 return new AutocompleteActionPredictor(profile); |
| 37 } | 39 } |
| 40 |
| 41 } // namespace predictors |
| OLD | NEW |