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

Unified Diff: content/browser/resources/media/manager.js

Issue 2672193003: media: Add "Hide players" button in about://media-internals (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | content/browser/resources/media/media_internals.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/resources/media/manager.js
diff --git a/content/browser/resources/media/manager.js b/content/browser/resources/media/manager.js
index 27f6b990eddf7568c2de03cef99694753e4f5263..3258e42e7618737f9ca6186d1bb0ceb3af3cee39 100644
--- a/content/browser/resources/media/manager.js
+++ b/content/browser/resources/media/manager.js
@@ -16,6 +16,9 @@ var Manager = (function() {
this.players_ = {};
this.audioComponents_ = [];
this.clientRenderer_ = clientRenderer;
+
+ this.hidePlayersButton = document.getElementById('hide-players-button');
+ this.hidePlayersButton.onclick = this.hidePlayers_.bind(this);
}
Manager.prototype = {
@@ -78,6 +81,12 @@ var Manager = (function() {
this.clientRenderer_.playerRemoved(this.players_, playerRemoved);
},
+ hidePlayers_: function() {
+ util.object.forEach(this.players_, function(playerInfo, id) {
+ this.removePlayer(id);
+ }, this);
+ },
+
updatePlayerInfoNoRecord: function(id, timestamp, key, value) {
if (!this.players_[id]) {
console.error('[updatePlayerInfo] Id ' + id + ' does not exist');
« no previous file with comments | « no previous file | content/browser/resources/media/media_internals.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698