| 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/autocomplete/autocomplete_classifier_factory.h" | 5 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 7 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 8 #include "chrome/browser/extensions/extension_system_factory.h" | 8 #include "chrome/browser/extensions/extension_system_factory.h" |
| 9 #include "chrome/browser/history/shortcuts_backend_factory.h" | 9 #include "chrome/browser/history/shortcuts_backend_factory.h" |
| 10 #include "chrome/browser/profiles/incognito_helpers.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_dependency_manager.h" | 12 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 12 #include "chrome/browser/search_engines/template_url_service_factory.h" | 13 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 13 | 14 |
| 14 | 15 |
| 15 // static | 16 // static |
| 16 AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( | 17 AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( |
| 17 Profile* profile) { | 18 Profile* profile) { |
| 18 return static_cast<AutocompleteClassifier*>( | 19 return static_cast<AutocompleteClassifier*>( |
| 19 GetInstance()->GetServiceForProfile(profile, true)); | 20 GetInstance()->GetServiceForProfile(profile, true)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 36 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); | 37 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
| 37 DependsOn(TemplateURLServiceFactory::GetInstance()); | 38 DependsOn(TemplateURLServiceFactory::GetInstance()); |
| 38 // TODO(pkasting): Uncomment these once they exist. | 39 // TODO(pkasting): Uncomment these once they exist. |
| 39 // DependsOn(PrefServiceFactory::GetInstance()); | 40 // DependsOn(PrefServiceFactory::GetInstance()); |
| 40 DependsOn(ShortcutsBackendFactory::GetInstance()); | 41 DependsOn(ShortcutsBackendFactory::GetInstance()); |
| 41 } | 42 } |
| 42 | 43 |
| 43 AutocompleteClassifierFactory::~AutocompleteClassifierFactory() { | 44 AutocompleteClassifierFactory::~AutocompleteClassifierFactory() { |
| 44 } | 45 } |
| 45 | 46 |
| 46 bool AutocompleteClassifierFactory::ServiceRedirectedInIncognito() const { | 47 content::BrowserContext* AutocompleteClassifierFactory::GetBrowserContextToUse( |
| 47 return true; | 48 content::BrowserContext* context) const { |
| 49 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 48 } | 50 } |
| 49 | 51 |
| 50 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { | 52 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { |
| 51 return true; | 53 return true; |
| 52 } | 54 } |
| 53 | 55 |
| 54 ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( | 56 ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( |
| 55 content::BrowserContext* profile) const { | 57 content::BrowserContext* profile) const { |
| 56 return BuildInstanceFor(static_cast<Profile*>(profile)); | 58 return BuildInstanceFor(static_cast<Profile*>(profile)); |
| 57 } | 59 } |
| OLD | NEW |