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

Unified Diff: chrome/browser/resources/media_internals/media_internals.js

Issue 7273089: Display active audio streams on chrome://media-internals. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Restructuring. Created 9 years, 6 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/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');
+};

Powered by Google App Engine
This is Rietveld 408576698