Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 var audioStreams = new AudioStreamStore; | |
| 6 var audioStreamDiv; | |
| 7 | |
| 8 // Receiving data for an audio stream. | |
| 9 // Add it to audioStreams and refresh. | |
| 10 onAudioUpdate = function(stream) { | |
| 11 audioStreams.addItem(stream); | |
| 12 audioStreamDiv.innerHTML = audioStreams.print(); | |
| 13 }; | |
| 14 | |
| 15 // Receiving all data. | |
| 16 // Add it all to the appropriate stores and refresh. | |
| 17 onReceiveEverything = function(stuff) { | |
| 18 audioStreams.addItems(stuff.audio_streams); | |
| 19 audioStreamDiv.innerHTML = audioStreams.print(); | |
| 20 }; | |
| 21 | |
| 22 // Removing an item from the appropriate store. | |
| 23 onItemDeleted = function(item) { | |
| 24 var type = item.split(".")[0]; | |
| 25 switch (type) { | |
| 26 case "audio_streams" : | |
|
scherkus (not reviewing)
2011/07/07 20:57:30
nit: remove extra space
Scott Franklin
2011/07/09 00:33:22
Done.
| |
| 27 audioStreams.removeItem(item); | |
| 28 audioStreamDiv.innerHTML = audioStreams.print(); | |
| 29 break; | |
| 30 } | |
| 31 }; | |
| 32 | |
| 33 window.onload = function() { | |
| 34 audioStreamDiv = document.getElementById('audio-streams'); | |
| 35 | |
| 36 // Get information about all currently active media. | |
| 37 chrome.send('getEverything'); | |
| 38 }; | |
| OLD | NEW |