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 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/prefs/pref_change_registrar.h" | 9 #include "base/prefs/pref_change_registrar.h" |
10 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
13 | 13 |
14 class ExtensionService; | 14 class ExtensionService; |
| 15 class HotwordClient; |
15 class Profile; | 16 class Profile; |
16 | 17 |
17 namespace hotword_internal { | 18 namespace hotword_internal { |
18 // Constants for the hotword field trial. | 19 // Constants for the hotword field trial. |
19 extern const char kHotwordFieldTrialName[]; | 20 extern const char kHotwordFieldTrialName[]; |
20 extern const char kHotwordFieldTrialDisabledGroupName[]; | 21 extern const char kHotwordFieldTrialDisabledGroupName[]; |
21 } // namespace hotword_internal | 22 } // namespace hotword_internal |
22 | 23 |
23 // Provides an interface for the Hotword component that does voice triggered | 24 // Provides an interface for the Hotword component that does voice triggered |
24 // search. | 25 // search. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 virtual bool RetryHotwordExtension(); | 66 virtual bool RetryHotwordExtension(); |
66 | 67 |
67 // Control the state of the hotword extension. | 68 // Control the state of the hotword extension. |
68 void EnableHotwordExtension(ExtensionService* extension_service); | 69 void EnableHotwordExtension(ExtensionService* extension_service); |
69 void DisableHotwordExtension(ExtensionService* extension_service); | 70 void DisableHotwordExtension(ExtensionService* extension_service); |
70 | 71 |
71 // Handles enabling/disabling the hotword extension when the user | 72 // Handles enabling/disabling the hotword extension when the user |
72 // turns it off via the settings menu. | 73 // turns it off via the settings menu. |
73 void OnHotwordSearchEnabledChanged(const std::string& pref_name); | 74 void OnHotwordSearchEnabledChanged(const std::string& pref_name); |
74 | 75 |
| 76 // Called to handle the hotword session from |client|. |
| 77 void RequestHotwordSession(HotwordClient* client); |
| 78 void StopHotwordSession(HotwordClient* client); |
| 79 HotwordClient* client() { return client_; } |
| 80 |
75 private: | 81 private: |
76 Profile* profile_; | 82 Profile* profile_; |
77 | 83 |
78 PrefChangeRegistrar pref_registrar_; | 84 PrefChangeRegistrar pref_registrar_; |
79 | 85 |
80 content::NotificationRegistrar registrar_; | 86 content::NotificationRegistrar registrar_; |
81 | 87 |
| 88 HotwordClient* client_; |
| 89 |
82 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 90 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
83 }; | 91 }; |
84 | 92 |
85 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 93 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
OLD | NEW |