Override server-side simple-cache trial with commandline switches.
[chromium-blink-merge.git] / chrome / browser / predictors / autocomplete_action_predictor_factory.cc
blobb5361c1e29655e008a559b95f0229f5f1a12ff06
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
3 // found in the LICENSE file.
5 #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h"
7 #include "chrome/browser/history/history_service_factory.h"
8 #include "chrome/browser/predictors/autocomplete_action_predictor.h"
9 #include "chrome/browser/predictors/predictor_database_factory.h"
10 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_dependency_manager.h"
14 namespace predictors {
16 // static
17 AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile(
18 Profile* profile) {
19 return static_cast<AutocompleteActionPredictor*>(
20 GetInstance()->GetServiceForProfile(profile, true));
23 // static
24 AutocompleteActionPredictorFactory*
25 AutocompleteActionPredictorFactory::GetInstance() {
26 return Singleton<AutocompleteActionPredictorFactory>::get();
29 AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory()
30 : ProfileKeyedServiceFactory("AutocompleteActionPredictor",
31 ProfileDependencyManager::GetInstance()) {
32 DependsOn(HistoryServiceFactory::GetInstance());
33 DependsOn(PredictorDatabaseFactory::GetInstance());
36 AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {}
38 content::BrowserContext*
39 AutocompleteActionPredictorFactory::GetBrowserContextToUse(
40 content::BrowserContext* context) const {
41 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
44 ProfileKeyedService*
45 AutocompleteActionPredictorFactory::BuildServiceInstanceFor(
46 content::BrowserContext* profile) const {
47 return new AutocompleteActionPredictor(static_cast<Profile*>(profile));
50 } // namespace predictors