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

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

Issue 1047973003: Notify hotwording extension of microphone state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/manager.js
diff --git a/chrome/browser/resources/hotword/manager.js b/chrome/browser/resources/hotword/manager.js
index d186a3f424b2ef9d7dc615277487fce700c69553..bfcabd89eae86d7edf8bf0ce623bb8bc7a6737d5 100644
--- a/chrome/browser/resources/hotword/manager.js
+++ b/chrome/browser/resources/hotword/manager.js
@@ -44,6 +44,16 @@
hotword.TrainingManager.handleSpeakerModelExists();
});
+ // Detect the microphone state has changed.
+ chrome.hotwordPrivate.onMicrophoneStateChanged.addListener(function(enabled) {
kcarattini 2015/03/31 23:31:46 How about making the PageAudioManager listen for t
calamity 2015/04/01 02:36:10 Good point. It also means I'm not calling private
+ if (enabled) {
+ pageAudioManager.updateTabState_();
+ return;
+ }
+
+ pageAudioManager.stopHotwording_();
+ });
+
// Detect when the shared module containing the NaCL module and language model
// is installed.
chrome.management.onInstalled.addListener(function(info) {

Powered by Google App Engine
This is Rietveld 408576698