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

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: Rebase 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 a74abfbd0e67268a13839cb5e9c0208ceb66f99a..422c79c8d30c134838e2233950b9e759f68e9443 100644
--- a/chrome/browser/search/hotword_service.h
+++ b/chrome/browser/search/hotword_service.h
@@ -29,6 +29,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
@@ -110,14 +112,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();
@@ -140,6 +152,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_;
« no previous file with comments | « chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc ('k') | chrome/browser/search/hotword_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698