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

Unified Diff: chrome/browser/resources/hotword/state_manager.js

Issue 687323003: Adds a Training Manager to the hotword extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tp3-api
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/hotword/state_manager.js
diff --git a/chrome/browser/resources/hotword/state_manager.js b/chrome/browser/resources/hotword/state_manager.js
index b55dc3dbef6f1296cbc033562ae000ff3e4a5c5c..d5339ce40da894d87d2d73c22a3f3bea0e27c069 100644
--- a/chrome/browser/resources/hotword/state_manager.js
+++ b/chrome/browser/resources/hotword/state_manager.js
@@ -160,6 +160,14 @@ cr.define('hotword', function() {
},
/**
+ * @return {boolean} True if training is enabled.
+ */
+ isTrainingEnabled: function() {
+ assert(this.hotwordStatus_, 'No hotword status (isTrainingEnabled)');
+ return this.hotwordStatus_.trainingEnabled;
+ },
+
+ /**
* Callback for hotwordPrivate.getStatus() function.
* @param {chrome.hotwordPrivate.StatusDetails} status Current hotword
* status.
@@ -181,7 +189,9 @@ cr.define('hotword', function() {
if (!this.hotwordStatus_)
return;
- if (this.hotwordStatus_.enabled || this.hotwordStatus_.alwaysOnEnabled) {
+ if (this.hotwordStatus_.enabled ||
+ this.hotwordStatus_.alwaysOnEnabled ||
+ this.hotwordStatus_.trainingEnabled) {
// Start the detector if there's a session, and shut it down if there
// isn't.
// NOTE(amistry): With always-on, we want a different behaviour with
« no previous file with comments | « chrome/browser/resources/hotword/manifest.json ('k') | chrome/browser/resources/hotword/training_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698