Bug 782289 - Headphones status notification. Part 2: Generate mozChromeEvent. r=vingtetun

Catching the 'headphones-status' event that is generated by AudioManager
and generating a mozChromeEvent matching. It will allow us to grab this
event in Gaia's status bar.
This commit is contained in:
Alexandre Lissy 2012-08-13 16:59:30 +02:00
Родитель d346b69ee9
Коммит 66c8014cf7
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -703,6 +703,15 @@ window.addEventListener('ContentStart', function ss_onContentStart() {
}, "geolocation-device-events", false);
})();
(function headphonesStatusTracker() {
Services.obs.addObserver(function(aSubject, aTopic, aData) {
shell.sendChromeEvent({
type: 'headphones-status',
state: aData
});
}, "headphones-status", false);
})();
(function recordingStatusTracker() {
let gRecordingActiveCount = 0;