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

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

Issue 557193002: Start and stop the hotword detector when the user opens/closes the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 6 years, 3 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
« no previous file with comments | « chrome/browser/resources/hotword/constants.js ('k') | chrome/browser/resources/hotword/state_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword/manager.js
diff --git a/chrome/browser/resources/hotword/manager.js b/chrome/browser/resources/hotword/manager.js
index 43a7bb9e976f7b09b0bb783ed892182f64ea8c0d..dfe4c7ef860388f86c02b934f2a01e6a28ff7ff0 100644
--- a/chrome/browser/resources/hotword/manager.js
+++ b/chrome/browser/resources/hotword/manager.js
@@ -43,10 +43,15 @@
// user has enabled always-on hotwording. But for now, always signal the
// start of a hotwording session. This allows this extension to work with
// the app launcher in the current state.
- chrome.hotwordPrivate.setHotwordSessionState(true, function() {});
+ stateManager.startSession(
+ hotword.constants.SessionSource.LAUNCHER,
+ function() {
+ chrome.hotwordPrivate.setHotwordSessionState(true, function() {});
+ });
});
chrome.hotwordPrivate.onHotwordSessionStopped.addListener(function() {
+ stateManager.stopSession(hotword.constants.SessionSource.LAUNCHER);
chrome.hotwordPrivate.setHotwordSessionState(false, function() {});
});
}());
« no previous file with comments | « chrome/browser/resources/hotword/constants.js ('k') | chrome/browser/resources/hotword/state_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698