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/incognito_helpers.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/search/hotword_service.h" | 10 #include "chrome/browser/search/hotword_service.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 void HotwordServiceFactory::RegisterProfilePrefs( | 41 void HotwordServiceFactory::RegisterProfilePrefs( |
42 user_prefs::PrefRegistrySyncable* prefs) { | 42 user_prefs::PrefRegistrySyncable* prefs) { |
43 prefs->RegisterBooleanPref(prefs::kHotwordSearchEnabled, | 43 prefs->RegisterBooleanPref(prefs::kHotwordSearchEnabled, |
44 false, | 44 false, |
45 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 45 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
46 prefs->RegisterBooleanPref(prefs::kHotwordSearchIncognitoEnabled, | 46 prefs->RegisterBooleanPref(prefs::kHotwordSearchIncognitoEnabled, |
47 false, | 47 false, |
48 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 48 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 49 prefs->RegisterBooleanPref(prefs::kHotwordSearchTimeoutEnabled, |
| 50 true, |
| 51 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
49 } | 52 } |
50 | 53 |
51 content::BrowserContext* HotwordServiceFactory::GetBrowserContextToUse( | 54 content::BrowserContext* HotwordServiceFactory::GetBrowserContextToUse( |
52 content::BrowserContext* context) const { | 55 content::BrowserContext* context) const { |
53 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 56 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
54 } | 57 } |
55 | 58 |
56 BrowserContextKeyedService* HotwordServiceFactory::BuildServiceInstanceFor( | 59 BrowserContextKeyedService* HotwordServiceFactory::BuildServiceInstanceFor( |
57 content::BrowserContext* profile) const { | 60 content::BrowserContext* profile) const { |
58 return new HotwordService(static_cast<Profile*>(profile)); | 61 return new HotwordService(static_cast<Profile*>(profile)); |
59 } | 62 } |
OLD | NEW |