Chromium Code Reviews| Index: chrome/browser/resources/media_internals/media_internals.js |
| diff --git a/chrome/browser/resources/media_internals/media_internals.js b/chrome/browser/resources/media_internals/media_internals.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e67530381641aa01df40721ac0142f14b5ecb212 |
| --- /dev/null |
| +++ b/chrome/browser/resources/media_internals/media_internals.js |
| @@ -0,0 +1,38 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +var audioStreams = new AudioStreamStore; |
| +var audioStreamDiv; |
| + |
| +// Receiving data for an audio stream. |
| +// Add it to audioStreams and refresh. |
| +onAudioUpdate = function(stream) { |
| + audioStreams.addItem(stream); |
| + audioStreamDiv.innerHTML = audioStreams.print(); |
| +}; |
| + |
| +// Receiving all data. |
| +// Add it all to the appropriate stores and refresh. |
| +onReceiveEverything = function(stuff) { |
| + audioStreams.addItems(stuff.audio_streams); |
| + audioStreamDiv.innerHTML = audioStreams.print(); |
| +}; |
| + |
| +// Removing an item from the appropriate store. |
| +onItemDeleted = function(item) { |
| + var type = item.split(".")[0]; |
| + switch (type) { |
| + 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.
|
| + audioStreams.removeItem(item); |
| + audioStreamDiv.innerHTML = audioStreams.print(); |
| + break; |
| + } |
| +}; |
| + |
| +window.onload = function() { |
| + audioStreamDiv = document.getElementById('audio-streams'); |
| + |
| + // Get information about all currently active media. |
| + chrome.send('getEverything'); |
| +}; |