diff options
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_classifier_factory.cc')
-rwxr-xr-x | chrome/browser/autocomplete/autocomplete_classifier_factory.cc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc new file mode 100755 index 0000000..30557fa --- /dev/null +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc @@ -0,0 +1,55 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" + +#include "chrome/browser/autocomplete/autocomplete_classifier.h" +#include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "chrome/browser/search_engines/template_url_service_factory.h" + + +// static +AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( + Profile* profile) { + return static_cast<AutocompleteClassifier*>( + GetInstance()->GetServiceForProfile(profile, true)); +} + +// static +AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { + return Singleton<AutocompleteClassifierFactory>::get(); +} + +// static +ProfileKeyedService* AutocompleteClassifierFactory::BuildInstanceFor( + Profile* profile) { + return new AutocompleteClassifier(profile); +} + +AutocompleteClassifierFactory::AutocompleteClassifierFactory() + : ProfileKeyedServiceFactory("AutocompleteClassifier", + ProfileDependencyManager::GetInstance()) { + DependsOn(ExtensionSystemFactory::GetInstance()); + DependsOn(TemplateURLServiceFactory::GetInstance()); + // TODO(pkasting): Uncomment these once they exist. + // DependsOn(PrefServiceFactory::GetInstance()); + // DependsOn(ShortcutsBackendFactory::GetInstance()); +} + +AutocompleteClassifierFactory::~AutocompleteClassifierFactory() { +} + +bool AutocompleteClassifierFactory::ServiceRedirectedInIncognito() { + return true; +} + +bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() { + return true; +} + +ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( + Profile* profile) const { + return BuildInstanceFor(profile); +} |