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 #ifndef CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ |
7 | 7 |
8 #include "base/prefs/pref_change_registrar.h" | 8 #include "base/prefs/pref_change_registrar.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 static BrowserContextKeyedAPIFactory<HotwordPrivateEventService>* | 27 static BrowserContextKeyedAPIFactory<HotwordPrivateEventService>* |
28 GetFactoryInstance(); | 28 GetFactoryInstance(); |
29 static const char* service_name(); | 29 static const char* service_name(); |
30 | 30 |
31 void OnEnabledChanged(const std::string& pref_name); | 31 void OnEnabledChanged(const std::string& pref_name); |
32 | 32 |
33 void OnHotwordSessionRequested(); | 33 void OnHotwordSessionRequested(); |
34 | 34 |
35 void OnHotwordSessionStopped(); | 35 void OnHotwordSessionStopped(); |
36 | 36 |
| 37 void OnHotwordTriggered(); |
| 38 |
| 39 void OnFinalizeSpeakerModel(); |
| 40 |
37 private: | 41 private: |
38 friend class BrowserContextKeyedAPIFactory<HotwordPrivateEventService>; | 42 friend class BrowserContextKeyedAPIFactory<HotwordPrivateEventService>; |
39 | 43 |
40 void SignalEvent(const std::string& event_name); | 44 void SignalEvent(const std::string& event_name); |
41 | 45 |
42 Profile* profile_; | 46 Profile* profile_; |
43 PrefChangeRegistrar pref_change_registrar_; | 47 PrefChangeRegistrar pref_change_registrar_; |
44 }; | 48 }; |
45 | 49 |
46 | 50 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.getLaunchState", | 130 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.getLaunchState", |
127 HOTWORDPRIVATE_GETLAUNCHSTATE) | 131 HOTWORDPRIVATE_GETLAUNCHSTATE) |
128 | 132 |
129 protected: | 133 protected: |
130 ~HotwordPrivateGetLaunchStateFunction() override {} | 134 ~HotwordPrivateGetLaunchStateFunction() override {} |
131 | 135 |
132 // ExtensionFunction: | 136 // ExtensionFunction: |
133 bool RunSync() override; | 137 bool RunSync() override; |
134 }; | 138 }; |
135 | 139 |
| 140 class HotwordPrivateStartTrainingFunction : |
| 141 public ChromeSyncExtensionFunction { |
| 142 public: |
| 143 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.startTraining", |
| 144 HOTWORDPRIVATE_STARTTRAINING) |
| 145 |
| 146 protected: |
| 147 ~HotwordPrivateStartTrainingFunction() override {} |
| 148 |
| 149 // ExtensionFunction: |
| 150 bool RunSync() override; |
| 151 }; |
| 152 |
| 153 class HotwordPrivateFinalizeSpeakerModelFunction : |
| 154 public ChromeSyncExtensionFunction { |
| 155 public: |
| 156 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.finalizeSpeakerModel", |
| 157 HOTWORDPRIVATE_FINALIZESPEAKERMODEL) |
| 158 |
| 159 protected: |
| 160 ~HotwordPrivateFinalizeSpeakerModelFunction() override {} |
| 161 |
| 162 // ExtensionFunction: |
| 163 bool RunSync() override; |
| 164 }; |
| 165 |
| 166 class HotwordPrivateStopTrainingFunction : |
| 167 public ChromeSyncExtensionFunction { |
| 168 public: |
| 169 DECLARE_EXTENSION_FUNCTION("hotwordPrivate.stopTraining", |
| 170 HOTWORDPRIVATE_STOPTRAINING) |
| 171 |
| 172 protected: |
| 173 ~HotwordPrivateStopTrainingFunction() override {} |
| 174 |
| 175 // ExtensionFunction: |
| 176 bool RunSync() override; |
| 177 }; |
| 178 |
136 } // namespace extensions | 179 } // namespace extensions |
137 | 180 |
138 #endif // CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ | 181 #endif // CHROME_BROWSER_EXTENSIONS_API_HOTWORD_PRIVATE_HOTWORD_PRIVATE_API_H_ |
OLD | NEW |