OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 * Class that wraps low-level details of interacting with the client plugin. | 7 * Class that wraps low-level details of interacting with the client plugin. |
8 * | 8 * |
9 * This abstracts a <embed> element and controls the plugin which does | 9 * This abstracts a <embed> element and controls the plugin which does |
10 * the actual remoting work. It also handles differences between | 10 * the actual remoting work. It also handles differences between |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 } | 196 } |
197 } else if (message.method == 'onFirstFrameReceived') { | 197 } else if (message.method == 'onFirstFrameReceived') { |
198 if (remoting.clientSession) { | 198 if (remoting.clientSession) { |
199 remoting.clientSession.onFirstFrameReceived(); | 199 remoting.clientSession.onFirstFrameReceived(); |
200 } | 200 } |
201 } else if (message.method == 'onConnectionReady') { | 201 } else if (message.method == 'onConnectionReady') { |
202 if (typeof message.data['ready'] != 'boolean') { | 202 if (typeof message.data['ready'] != 'boolean') { |
203 console.error('Received incorrect onConnectionReady message.'); | 203 console.error('Received incorrect onConnectionReady message.'); |
204 return; | 204 return; |
205 } | 205 } |
206 this.onConnectionReadyHandler(message.data['ready']); | 206 var ready = /** @type {boolean} */ message.data['ready']; |
207 this.onConnectionReadyHandler(ready); | |
Sergey Ulanov
2012/07/23 21:39:34
Might be better to write like this:
this.onConne
garykac
2012/07/23 22:45:25
I tried that first and it didn't work. Not sure wh
| |
207 } | 208 } |
208 } | 209 } |
209 | 210 |
210 /** | 211 /** |
211 * Deletes the plugin. | 212 * Deletes the plugin. |
212 */ | 213 */ |
213 remoting.ClientPluginAsync.prototype.cleanup = function() { | 214 remoting.ClientPluginAsync.prototype.cleanup = function() { |
214 this.plugin.parentNode.removeChild(this.plugin); | 215 this.plugin.parentNode.removeChild(this.plugin); |
215 }; | 216 }; |
216 | 217 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 this.plugin.width = width; | 411 this.plugin.width = width; |
411 this.plugin.height = height; | 412 this.plugin.height = height; |
412 // Center the plugin just underneath the "Connnecting..." dialog. | 413 // Center the plugin just underneath the "Connnecting..." dialog. |
413 var parentNode = this.plugin.parentNode; | 414 var parentNode = this.plugin.parentNode; |
414 var dialog = document.getElementById('client-dialog'); | 415 var dialog = document.getElementById('client-dialog'); |
415 var dialogRect = dialog.getBoundingClientRect(); | 416 var dialogRect = dialog.getBoundingClientRect(); |
416 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; | 417 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; |
417 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; | 418 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; |
418 } | 419 } |
419 }; | 420 }; |
OLD | NEW |