Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 | 29 |
| 30 /** @param {string} iq The Iq stanza received from the host. */ | 30 /** @param {string} iq The Iq stanza received from the host. */ |
| 31 this.onOutgoingIqHandler = function (iq) {}; | 31 this.onOutgoingIqHandler = function (iq) {}; |
| 32 /** @param {string} message Log message. */ | 32 /** @param {string} message Log message. */ |
| 33 this.onDebugMessageHandler = function (message) {}; | 33 this.onDebugMessageHandler = function (message) {}; |
| 34 /** | 34 /** |
| 35 * @param {number} state The connection state. | 35 * @param {number} state The connection state. |
| 36 * @param {number} error The error code, if any. | 36 * @param {number} error The error code, if any. |
| 37 */ | 37 */ |
| 38 this.onConnectionStatusUpdateHandler = function(state, error) {}; | 38 this.onConnectionStatusUpdateHandler = function(state, error) {}; |
| 39 /** @param {boolean} inactive Connection inactivity state. */ | |
| 40 this.onConnectionInactiveHandler = function(inactive) {}; | |
| 39 this.onDesktopSizeUpdateHandler = function () {}; | 41 this.onDesktopSizeUpdateHandler = function () {}; |
|
Wez
2012/07/16 18:51:23
nit: Add a comment for the desktop size update han
Sergey Ulanov
2012/07/17 01:17:18
onDesktopSizeUpdateHandler() doesn't have any para
| |
| 40 | 42 |
| 41 /** @type {number} */ | 43 /** @type {number} */ |
| 42 this.pluginApiVersion_ = -1; | 44 this.pluginApiVersion_ = -1; |
| 43 /** @type {Array.<string>} */ | 45 /** @type {Array.<string>} */ |
| 44 this.pluginApiFeatures_ = []; | 46 this.pluginApiFeatures_ = []; |
| 45 /** @type {number} */ | 47 /** @type {number} */ |
| 46 this.pluginApiMinVersion_ = -1; | 48 this.pluginApiMinVersion_ = -1; |
| 47 /** @type {boolean} */ | 49 /** @type {boolean} */ |
| 48 this.helloReceived_ = false; | 50 this.helloReceived_ = false; |
| 49 /** @type {function(boolean)|null} */ | 51 /** @type {function(boolean)|null} */ |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 return; | 185 return; |
| 184 } | 186 } |
| 185 if (remoting.clipboard) { | 187 if (remoting.clipboard) { |
| 186 remoting.clipboard.fromHost(message.data['mimeType'], | 188 remoting.clipboard.fromHost(message.data['mimeType'], |
| 187 message.data['item']); | 189 message.data['item']); |
| 188 } | 190 } |
| 189 } else if (message.method == 'onFirstFrameReceived') { | 191 } else if (message.method == 'onFirstFrameReceived') { |
| 190 if (remoting.clientSession) { | 192 if (remoting.clientSession) { |
| 191 remoting.clientSession.onFirstFrameReceived(); | 193 remoting.clientSession.onFirstFrameReceived(); |
| 192 } | 194 } |
| 195 } else if (message.method == 'onConnectionInactive') { | |
| 196 if (typeof message.data['inactive'] != 'boolean') { | |
| 197 console.error('Received incorrect onConnectionInactive message.'); | |
| 198 return; | |
| 199 } | |
| 200 this.onConnectionInactiveHandler(message.data['inactive']); | |
| 193 } | 201 } |
| 194 } | 202 } |
| 195 | 203 |
| 196 /** | 204 /** |
| 197 * Deletes the plugin. | 205 * Deletes the plugin. |
| 198 */ | 206 */ |
| 199 remoting.ClientPluginAsync.prototype.cleanup = function() { | 207 remoting.ClientPluginAsync.prototype.cleanup = function() { |
| 200 this.plugin.parentNode.removeChild(this.plugin); | 208 this.plugin.parentNode.removeChild(this.plugin); |
| 201 }; | 209 }; |
| 202 | 210 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 396 this.plugin.width = width; | 404 this.plugin.width = width; |
| 397 this.plugin.height = height; | 405 this.plugin.height = height; |
| 398 // Center the plugin just underneath the "Connnecting..." dialog. | 406 // Center the plugin just underneath the "Connnecting..." dialog. |
| 399 var parentNode = this.plugin.parentNode; | 407 var parentNode = this.plugin.parentNode; |
| 400 var dialog = document.getElementById('client-dialog'); | 408 var dialog = document.getElementById('client-dialog'); |
| 401 var dialogRect = dialog.getBoundingClientRect(); | 409 var dialogRect = dialog.getBoundingClientRect(); |
| 402 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; | 410 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; |
| 403 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; | 411 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; |
| 404 } | 412 } |
| 405 }; | 413 }; |
| OLD | NEW |