blob: 8b75b45c84f4e235b327bb371b7c5a02c10e8c72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// 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/history/shortcuts_backend_factory.h"
#include "chrome/browser/profiles/profile.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(
content::BrowserContext* profile) {
return new AutocompleteClassifier(static_cast<Profile*>(profile));
}
AutocompleteClassifierFactory::AutocompleteClassifierFactory()
: ProfileKeyedServiceFactory("AutocompleteClassifier",
ProfileDependencyManager::GetInstance()) {
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
DependsOn(TemplateURLServiceFactory::GetInstance());
// TODO(pkasting): Uncomment these once they exist.
// DependsOn(PrefServiceFactory::GetInstance());
DependsOn(ShortcutsBackendFactory::GetInstance());
}
AutocompleteClassifierFactory::~AutocompleteClassifierFactory() {
}
bool AutocompleteClassifierFactory::ServiceRedirectedInIncognito() const {
return true;
}
bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const {
return true;
}
ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
return BuildInstanceFor(static_cast<Profile*>(profile));
}
|