Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Keeps track of all the existing | 6 * @fileoverview Keeps track of all the existing |
| 7 * PlayerProperty objects and is the entry-point for messages from the backend. | 7 * PlayerProperty objects and is the entry-point for messages from the backend. |
| 8 */ | 8 */ |
| 9 var PlayerManager = (function() { | 9 var PlayerManager = (function() { |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 // remove it from the UI | 44 // remove it from the UI |
| 45 if (this.shouldRemovePlayer_()) { | 45 if (this.shouldRemovePlayer_()) { |
| 46 delete this.players_[id]; | 46 delete this.players_[id]; |
| 47 this.renderman_.redrawList(); | 47 this.renderman_.redrawList(); |
| 48 } else if (this.players_[id]) { | 48 } else if (this.players_[id]) { |
| 49 // Set a property on it to be removed at a later time | 49 // Set a property on it to be removed at a later time |
| 50 this.players_[id].toRemove = true; | 50 this.players_[id].toRemove = true; |
| 51 } | 51 } |
| 52 }, | 52 }, |
| 53 | 53 |
| 54 removeAllForDebug: function() { | |
|
scherkus (not reviewing)
2013/07/29 20:35:54
s/ForDebug/ForTest/
also ... remove all of what?
Ty Overby
2013/07/29 21:53:31
I like the idea of modifying the media singleton t
| |
| 55 this.players_ = {}; | |
| 56 }, | |
| 57 | |
| 54 /** | 58 /** |
| 55 * Selects a player and displays it on the UI. | 59 * Selects a player and displays it on the UI. |
| 56 * This method is called from the UI. | 60 * This method is called from the UI. |
| 57 * @param id The ID of the player to display. | 61 * @param id The ID of the player to display. |
| 58 */ | 62 */ |
| 59 selectPlayer: function(id) { | 63 selectPlayer: function(id) { |
| 60 if (!this.players_[id]) { | 64 if (!this.players_[id]) { |
| 61 throw new Error('[selectPlayer] Id ' + id + ' does not exist.'); | 65 throw new Error('[selectPlayer] Id ' + id + ' does not exist.'); |
| 62 } | 66 } |
| 63 | 67 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 if (key === 'name' || key === 'url') { | 106 if (key === 'name' || key === 'url') { |
| 103 this.renderman_.redrawList(); | 107 this.renderman_.redrawList(); |
| 104 } | 108 } |
| 105 | 109 |
| 106 this.renderman_.update(); | 110 this.renderman_.update(); |
| 107 } | 111 } |
| 108 }; | 112 }; |
| 109 | 113 |
| 110 return PlayerManager; | 114 return PlayerManager; |
| 111 }()); | 115 }()); |
| OLD | NEW |