OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/hotword_private/hotword_private_api.h" | 5 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.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" |
11 #include "chrome/browser/search/hotword_service_factory.h" | 11 #include "chrome/browser/search/hotword_service_factory.h" |
12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
13 #include "extensions/browser/event_router.h" | 13 #include "extensions/browser/event_router.h" |
| 14 #include "extensions/browser/extension_system.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 namespace OnEnabledChanged = | 18 namespace OnEnabledChanged = |
18 api::hotword_private::OnEnabledChanged; | 19 api::hotword_private::OnEnabledChanged; |
19 | 20 |
20 static base::LazyInstance< | 21 static base::LazyInstance< |
21 ProfileKeyedAPIFactory<HotwordPrivateEventService> > g_factory = | 22 ProfileKeyedAPIFactory<HotwordPrivateEventService> > g_factory = |
22 LAZY_INSTANCE_INITIALIZER; | 23 LAZY_INSTANCE_INITIALIZER; |
23 | 24 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 87 |
87 PrefService* prefs = GetProfile()->GetPrefs(); | 88 PrefService* prefs = GetProfile()->GetPrefs(); |
88 result.enabled = | 89 result.enabled = |
89 prefs->GetBoolean(prefs::kHotwordSearchEnabled); | 90 prefs->GetBoolean(prefs::kHotwordSearchEnabled); |
90 | 91 |
91 SetResult(result.ToValue().release()); | 92 SetResult(result.ToValue().release()); |
92 return true; | 93 return true; |
93 } | 94 } |
94 | 95 |
95 } // namespace extensions | 96 } // namespace extensions |
OLD | NEW |