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

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: 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/resources/hotword/state_manager.js
diff --git a/chrome/browser/resources/hotword/state_manager.js b/chrome/browser/resources/hotword/state_manager.js
index 67d4f41923f35fc1513a8493551b64db3e371e81..72a40785abcb210aac5e588b01c35fcc3d2f4d08 100644
--- a/chrome/browser/resources/hotword/state_manager.js
+++ b/chrome/browser/resources/hotword/state_manager.js
@@ -157,6 +157,14 @@ cr.define('hotword', function() {
},
/**
+ * @return {boolean} True if training is enabled.
+ */
+ isTrainingEnabled: function() {
+ assert(this.hotwordStatus_, 'No hotword status (isAlwaysOnEnabled)');
Anand Mistry (off Chromium) 2014/10/30 03:53:12 isAlwaysOnEnabled?
kcarattini 2014/10/30 05:27:06 Done.
+ return this.hotwordStatus_.trainingEnabled;
+ },
+
+ /**
* Callback for hotwordPrivate.getStatus() function.
* @param {chrome.hotwordPrivate.StatusDetails} status Current hotword
* status.
@@ -178,7 +186,7 @@ cr.define('hotword', function() {
if (!this.hotwordStatus_)
return;
- if (this.hotwordStatus_.enabled) {
+ if (this.hotwordStatus_.enabled || 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

Powered by Google App Engine
This is Rietveld 408576698