| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 user_prefs::PrefRegistrySyncable* prefs) { | 50 user_prefs::PrefRegistrySyncable* prefs) { |
| 51 prefs->RegisterBooleanPref(prefs::kHotwordSearchEnabled, | 51 prefs->RegisterBooleanPref(prefs::kHotwordSearchEnabled, |
| 52 false, | 52 false, |
| 53 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 53 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 54 prefs->RegisterBooleanPref(prefs::kHotwordSearchIncognitoEnabled, | 54 prefs->RegisterBooleanPref(prefs::kHotwordSearchIncognitoEnabled, |
| 55 false, | 55 false, |
| 56 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 56 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 57 prefs->RegisterIntegerPref(prefs::kHotwordOptInPopupTimesShown, | 57 prefs->RegisterIntegerPref(prefs::kHotwordOptInPopupTimesShown, |
| 58 0, | 58 0, |
| 59 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 59 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 60 prefs->RegisterBooleanPref(prefs::kHotwordSearchTimeoutEnabled, |
| 61 true, |
| 62 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 60 } | 63 } |
| 61 | 64 |
| 62 content::BrowserContext* HotwordServiceFactory::GetBrowserContextToUse( | 65 content::BrowserContext* HotwordServiceFactory::GetBrowserContextToUse( |
| 63 content::BrowserContext* context) const { | 66 content::BrowserContext* context) const { |
| 64 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 67 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 65 } | 68 } |
| 66 | 69 |
| 67 BrowserContextKeyedService* HotwordServiceFactory::BuildServiceInstanceFor( | 70 BrowserContextKeyedService* HotwordServiceFactory::BuildServiceInstanceFor( |
| 68 content::BrowserContext* profile) const { | 71 content::BrowserContext* profile) const { |
| 69 return new HotwordService(static_cast<Profile*>(profile)); | 72 return new HotwordService(static_cast<Profile*>(profile)); |
| 70 } | 73 } |
| OLD | NEW |