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

Unified Diff: chrome/browser/search/hotword_service.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, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search/hotword_service.h
diff --git a/chrome/browser/search/hotword_service.h b/chrome/browser/search/hotword_service.h
index 79e22d968d350c8ef0c6bdfdf0234851db210174..7f99432db486939d892210dfd10adeb566c4a865 100644
--- a/chrome/browser/search/hotword_service.h
+++ b/chrome/browser/search/hotword_service.h
@@ -28,6 +28,8 @@ namespace hotword_internal {
// Constants for the hotword field trial.
extern const char kHotwordFieldTrialName[];
extern const char kHotwordFieldTrialDisabledGroupName[];
+// String passed to indicate the training state has changed.
+extern const char kHotwordTrainingEnabled[];
} // namespace hotword_internal
// Provides an interface for the Hotword component that does voice triggered
@@ -109,14 +111,24 @@ class HotwordService : public extensions::ExtensionRegistryObserver,
// at which time we can simply launch the app in the given mode instead of
// having to check for it here.
enum LaunchMode {
- AUDIO_HISTORY_ONLY,
HOTWORD_ONLY,
HOTWORD_AND_AUDIO_HISTORY,
- SPEECH_TRAINING
+ RETRAIN
};
void LaunchHotwordAudioVerificationApp(const LaunchMode& launch_mode);
virtual LaunchMode GetHotwordAudioVerificationLaunchMode();
+ // These methods control the speaker training communication between
+ // the Hotword Audio Verification App and the Hotword Extension that
+ // contains the NaCl module.
+ void StartTraining();
+ void FinalizeSpeakerModel();
+ void StopTraining();
+ void NotifyHotwordTriggered();
+
+ // Returns true if speaker training is currently in progress.
+ bool IsTraining();
+
private:
// Returns the ID of the extension that may need to be reinstalled.
std::string ReinstalledExtensionId();
@@ -137,6 +149,8 @@ class HotwordService : public extensions::ExtensionRegistryObserver,
HotwordClient* client_;
int error_message_;
bool reinstall_pending_;
+ // Whether we are currently in the process of training the speaker model.
+ bool training_;
base::WeakPtrFactory<HotwordService> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698