OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/hotword_service_factory.h" | 5 #include "chrome/browser/search/hotword_service_factory.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/incognito_helpers.h" | |
8 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/search/hotword_service.h" | 10 #include "chrome/browser/search/hotword_service.h" |
10 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 12 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
12 #include "components/pref_registry/pref_registry_syncable.h" | 13 #include "components/pref_registry/pref_registry_syncable.h" |
13 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 | 16 |
16 using content::BrowserContext; | 17 using content::BrowserContext; |
17 using content::BrowserThread; | 18 using content::BrowserThread; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 true, | 105 true, |
105 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 106 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
106 prefs->RegisterStringPref(prefs::kHotwordPreviousLanguage, | 107 prefs->RegisterStringPref(prefs::kHotwordPreviousLanguage, |
107 std::string(), | 108 std::string(), |
108 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 109 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
109 prefs->RegisterBooleanPref(prefs::kHotwordAlwaysOnSearchEnabled, | 110 prefs->RegisterBooleanPref(prefs::kHotwordAlwaysOnSearchEnabled, |
110 false, | 111 false, |
111 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 112 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
112 } | 113 } |
113 | 114 |
115 content::BrowserContext* HotwordServiceFactory::GetBrowserContextToUse( | |
116 content::BrowserContext* context) const { | |
117 return chrome::GetBrowserContextRedirectedInIncognito(context); | |
rpetterson
2014/09/08 17:35:01
With this change, this will now return the origina
| |
118 } | |
119 | |
114 KeyedService* HotwordServiceFactory::BuildServiceInstanceFor( | 120 KeyedService* HotwordServiceFactory::BuildServiceInstanceFor( |
115 BrowserContext* context) const { | 121 BrowserContext* context) const { |
116 return new HotwordService(Profile::FromBrowserContext(context)); | 122 return new HotwordService(Profile::FromBrowserContext(context)); |
117 } | 123 } |
OLD | NEW |