Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function() { | 5 (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * @fileoverview This extension provides hotword triggering capabilites to | 9 * @fileoverview This extension provides hotword triggering capabilites to |
| 10 * Chrome. | 10 * Chrome. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // Detect a request to delete the speaker model. | 37 // Detect a request to delete the speaker model. |
| 38 chrome.hotwordPrivate.onDeleteSpeakerModel.addListener(function() { | 38 chrome.hotwordPrivate.onDeleteSpeakerModel.addListener(function() { |
| 39 hotword.TrainingManager.handleDeleteSpeakerModel(); | 39 hotword.TrainingManager.handleDeleteSpeakerModel(); |
| 40 }); | 40 }); |
| 41 | 41 |
| 42 // Detect a request for the speaker model existence. | 42 // Detect a request for the speaker model existence. |
| 43 chrome.hotwordPrivate.onSpeakerModelExists.addListener(function() { | 43 chrome.hotwordPrivate.onSpeakerModelExists.addListener(function() { |
| 44 hotword.TrainingManager.handleSpeakerModelExists(); | 44 hotword.TrainingManager.handleSpeakerModelExists(); |
| 45 }); | 45 }); |
| 46 | 46 |
| 47 // Detect the microphone state has changed. | |
| 48 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
| |
| 49 if (enabled) { | |
| 50 pageAudioManager.updateTabState_(); | |
| 51 return; | |
| 52 } | |
| 53 | |
| 54 pageAudioManager.stopHotwording_(); | |
| 55 }); | |
| 56 | |
| 47 // Detect when the shared module containing the NaCL module and language model | 57 // Detect when the shared module containing the NaCL module and language model |
| 48 // is installed. | 58 // is installed. |
| 49 chrome.management.onInstalled.addListener(function(info) { | 59 chrome.management.onInstalled.addListener(function(info) { |
| 50 if (info.id == hotword.constants.SHARED_MODULE_ID) { | 60 if (info.id == hotword.constants.SHARED_MODULE_ID) { |
| 51 hotword.debug('Shared module installed, reloading extension.'); | 61 hotword.debug('Shared module installed, reloading extension.'); |
| 52 chrome.runtime.reload(); | 62 chrome.runtime.reload(); |
| 53 } | 63 } |
| 54 }); | 64 }); |
| 55 }()); | 65 }()); |
| OLD | NEW |