Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: chrome/browser/extensions/api/hotword_private/hotword_private_api.h

Issue 686333002: Hotword Private API: Adds speech training functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests for Finalize Speaker Model Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698