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

Side by Side Diff: content/browser/resources/media/new/player_list_painter.js

Issue 18889006: Removed old media-internals page and rewrote it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved all 'new' media internals files into its own folder for a smooth transition. Created 7 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 playerListPainter = (function () {
6 "use strict";
7 var playerListPainter = {};
8
9 playerListPainter.paintNew = function (playerInfo, div, opt_properties) {
10 var ul = document.createElement('ul');
11 var playerManager = opt_properties.playerManager;
12
13 goog.object.forEach(playerManager.players, function (player, id) {
14 // If we have the opportunity to name it
15 // something human readable, do so.
16
17 var name;
18 // If we have a url, use the file name (but not path) as the
19 // name that is displayed
20 if (player.properties.url) {
21 var split = player.properties.url.split("/");
22 name = split[split.length - 1];
23 }
24
25 name = name || player.properties.name || "player " + id;
26 var li = document.createElement('li');
27 var btn = document.createElement('button');
28
29 btn.onclick = function () {
30 playerManager.selectPlayer(id);
31 };
32
33 btn.appendChild(document.createTextNode(name));
34 li.appendChild(btn);
35 ul.appendChild(li);
36 });
37
38 removeChildren(div);
39 div.appendChild(ul);
40 };
41
42 playerListPainter.paintExist = playerListPainter.paintNew;
43
44 playerListPainter.invalidate = function () {
45 };
46
47 return playerListPainter;
48 }());
OLDNEW
« no previous file with comments | « content/browser/resources/media/new/player_info.js ('k') | content/browser/resources/media/new/player_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698