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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // At the moment the webapp does not recognize any of | 165 // At the moment the webapp does not recognize any of |
166 // 'requestedCapabilities' capabilities (so they all should be disabled) | 166 // 'requestedCapabilities' capabilities (so they all should be disabled) |
167 // and do not care about any of 'supportedCapabilities' capabilities (so | 167 // and do not care about any of 'supportedCapabilities' capabilities (so |
168 // they all can be enabled). | 168 // they all can be enabled). |
169 this.capabilities_ = supportedCapabilities; | 169 this.capabilities_ = supportedCapabilities; |
170 | 170 |
171 // Let the host know that the webapp can be requested to always send | 171 // Let the host know that the webapp can be requested to always send |
172 // the client's dimensions. | 172 // the client's dimensions. |
173 this.capabilities_.push( | 173 this.capabilities_.push( |
174 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION); | 174 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION); |
| 175 |
| 176 // Let the host know that we're interested in knowing whether or not |
| 177 // it rate-limits desktop-resize requests. |
| 178 this.capabilities_.push( |
| 179 remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS); |
175 } else if (this.pluginApiVersion_ >= 6) { | 180 } else if (this.pluginApiVersion_ >= 6) { |
176 this.pluginApiFeatures_ = ['highQualityScaling', 'injectKeyEvent']; | 181 this.pluginApiFeatures_ = ['highQualityScaling', 'injectKeyEvent']; |
177 } else { | 182 } else { |
178 this.pluginApiFeatures_ = ['highQualityScaling']; | 183 this.pluginApiFeatures_ = ['highQualityScaling']; |
179 } | 184 } |
180 this.pluginApiMinVersion_ = | 185 this.pluginApiMinVersion_ = |
181 /** @type {number} */ message.data['apiMinVersion']; | 186 /** @type {number} */ message.data['apiMinVersion']; |
182 this.helloReceived_ = true; | 187 this.helloReceived_ = true; |
183 if (this.onInitializedCallback_ != null) { | 188 if (this.onInitializedCallback_ != null) { |
184 this.onInitializedCallback_(true); | 189 this.onInitializedCallback_(true); |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 this.plugin.width = width; | 618 this.plugin.width = width; |
614 this.plugin.height = height; | 619 this.plugin.height = height; |
615 // Center the plugin just underneath the "Connnecting..." dialog. | 620 // Center the plugin just underneath the "Connnecting..." dialog. |
616 var parentNode = this.plugin.parentNode; | 621 var parentNode = this.plugin.parentNode; |
617 var dialog = document.getElementById('client-dialog'); | 622 var dialog = document.getElementById('client-dialog'); |
618 var dialogRect = dialog.getBoundingClientRect(); | 623 var dialogRect = dialog.getBoundingClientRect(); |
619 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; | 624 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; |
620 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; | 625 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; |
621 } | 626 } |
622 }; | 627 }; |
OLD | NEW |