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 | 6 * @fileoverview |
7 * Dialog for showing the list of clients that are paired with this host. | 7 * Dialog for showing the list of clients that are paired with this host. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return typeof(this.clientId) == 'string' && | 84 return typeof(this.clientId) == 'string' && |
85 typeof(this.clientName) == 'string' && | 85 typeof(this.clientName) == 'string' && |
86 typeof(this.createdTime) == 'number'; | 86 typeof(this.createdTime) == 'number'; |
87 }; | 87 }; |
88 | 88 |
89 /** | 89 /** |
90 * Converts a raw object to an array of PairedClient instances. Returns null if | 90 * Converts a raw object to an array of PairedClient instances. Returns null if |
91 * the input object is incorrectly formatted. | 91 * the input object is incorrectly formatted. |
92 * | 92 * |
93 * @param {*} pairedClients The object to convert. | 93 * @param {*} pairedClients The object to convert. |
94 * @return {Array.<remoting.PairedClient>} The converted result. | 94 * @return {Array<remoting.PairedClient>} The converted result. |
95 */ | 95 */ |
96 remoting.PairedClient.convertToPairedClientArray = function(pairedClients) { | 96 remoting.PairedClient.convertToPairedClientArray = function(pairedClients) { |
97 if (!(pairedClients instanceof Array)) { | 97 if (!(pairedClients instanceof Array)) { |
98 console.error('pairedClients is not an Array:', pairedClients); | 98 console.error('pairedClients is not an Array:', pairedClients); |
99 return null; | 99 return null; |
100 } | 100 } |
101 | 101 |
102 var result = []; | 102 var result = []; |
103 for (var i = 0; i < pairedClients.length; i++) { | 103 for (var i = 0; i < pairedClients.length; i++) { |
104 var pairedClient = new remoting.PairedClient(pairedClients[i]); | 104 var pairedClient = new remoting.PairedClient(pairedClients[i]); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 /** | 161 /** |
162 * @private | 162 * @private |
163 */ | 163 */ |
164 this.errorDiv_ = errorDiv; | 164 this.errorDiv_ = errorDiv; |
165 /** | 165 /** |
166 * @type {Element} | 166 * @type {Element} |
167 * @private | 167 * @private |
168 */ | 168 */ |
169 this.clientRows_ = listContainer.querySelector('tbody'); | 169 this.clientRows_ = listContainer.querySelector('tbody'); |
170 /** | 170 /** |
171 * @type {Array.<remoting.PairedClient>} | 171 * @type {Array<remoting.PairedClient>} |
172 */ | 172 */ |
173 this.pairedClients_ = []; | 173 this.pairedClients_ = []; |
174 | 174 |
175 this.deleteAllButton_.addEventListener('click', | 175 this.deleteAllButton_.addEventListener('click', |
176 this.deleteAll_.bind(this), | 176 this.deleteAll_.bind(this), |
177 false); | 177 false); |
178 }; | 178 }; |
179 | 179 |
180 /** | 180 /** |
181 * Populate the dialog with the list of paired clients and show or hide the | 181 * Populate the dialog with the list of paired clients and show or hide the |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 * @return {string} The client id of the first paired client in the list. | 278 * @return {string} The client id of the first paired client in the list. |
279 */ | 279 */ |
280 remoting.PairedClientManager.prototype.getFirstClientIdForTesting_ = | 280 remoting.PairedClientManager.prototype.getFirstClientIdForTesting_ = |
281 function() { | 281 function() { |
282 return this.pairedClients_.length > 0 ? this.pairedClients_[0].clientId : ''; | 282 return this.pairedClients_.length > 0 ? this.pairedClients_[0].clientId : ''; |
283 }; | 283 }; |
284 | 284 |
285 | 285 |
286 /** @type {remoting.PairedClientManager} */ | 286 /** @type {remoting.PairedClientManager} */ |
287 remoting.pairedClientManager = null; | 287 remoting.pairedClientManager = null; |
OLD | NEW |