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

Side by Side Diff: chrome/browser/predictors/autocomplete_action_predictor_factory.cc

Issue 10380041: Refactoring AutocompleteActionPredictor Database. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Syncing to HEAD Created 8 years, 7 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/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/predictors/predictor_database_factory.h"
8 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h" 10 #include "chrome/browser/profiles/profile_dependency_manager.h"
10 11
12 namespace predictors {
13
11 // static 14 // static
12 AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile( 15 AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile(
13 Profile* profile) { 16 Profile* profile) {
14 return static_cast<AutocompleteActionPredictor*>( 17 return static_cast<AutocompleteActionPredictor*>(
15 GetInstance()->GetServiceForProfile(profile, true)); 18 GetInstance()->GetServiceForProfile(profile, true));
16 } 19 }
17 20
18 // static 21 // static
19 AutocompleteActionPredictorFactory* 22 AutocompleteActionPredictorFactory*
20 AutocompleteActionPredictorFactory::GetInstance() { 23 AutocompleteActionPredictorFactory::GetInstance() {
21 return Singleton<AutocompleteActionPredictorFactory>::get(); 24 return Singleton<AutocompleteActionPredictorFactory>::get();
22 } 25 }
23 26
24 AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory() 27 AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory()
25 : ProfileKeyedServiceFactory("AutocompleteActionPredictor", 28 : ProfileKeyedServiceFactory("AutocompleteActionPredictor",
26 ProfileDependencyManager::GetInstance()) { 29 ProfileDependencyManager::GetInstance()) {
27 // TODO(erg): When HistoryService is PKSFized, uncomment this. 30 // TODO(erg): When HistoryService is PKSFized, uncomment this.
28 // DependsOn(HistoryServiceFactory::GetInstance()); 31 // DependsOn(HistoryServiceFactory::GetInstance());
32 DependsOn(PredictorDatabaseFactory::GetInstance());
29 } 33 }
30 34
31 AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {} 35 AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {}
32 36
33 ProfileKeyedService* 37 ProfileKeyedService*
34 AutocompleteActionPredictorFactory::BuildServiceInstanceFor( 38 AutocompleteActionPredictorFactory::BuildServiceInstanceFor(
35 Profile* profile) const { 39 Profile* profile) const {
36 return new AutocompleteActionPredictor(profile); 40 return new AutocompleteActionPredictor(profile);
37 } 41 }
42
43 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698