| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 /** | 261 /** |
| 262 * Release all currently pressed keys. | 262 * Release all currently pressed keys. |
| 263 */ | 263 */ |
| 264 remoting.ClientPluginAsync.prototype.releaseAllKeys = function() { | 264 remoting.ClientPluginAsync.prototype.releaseAllKeys = function() { |
| 265 this.plugin.postMessage(JSON.stringify( | 265 this.plugin.postMessage(JSON.stringify( |
| 266 { method: 'releaseAllKeys', data: {} })); | 266 { method: 'releaseAllKeys', data: {} })); |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 /** | 269 /** |
| 270 * Send a key event to the host. | |
| 271 * | |
| 272 * @param {number} usb_keycode The USB-style code of the key to inject. | |
| 273 * @param {boolean} pressed True to inject a key press, False for a release. | |
| 274 */ | |
| 275 remoting.ClientPluginAsync.prototype.injectKey = | |
| 276 function(usb_keycode, pressed) { | |
| 277 this.plugin.postMessage(JSON.stringify( | |
| 278 { method: 'injectKeyEvent', data: { | |
| 279 'usb_keycode': usb_keycode, | |
| 280 'pressed': pressed} | |
| 281 })); | |
| 282 }; | |
| 283 | |
| 284 /** | |
| 285 * Returns an associative array with a set of stats for this connecton. | 270 * Returns an associative array with a set of stats for this connecton. |
| 286 * | 271 * |
| 287 * @return {remoting.ClientSession.PerfStats} The connection statistics. | 272 * @return {remoting.ClientSession.PerfStats} The connection statistics. |
| 288 */ | 273 */ |
| 289 remoting.ClientPluginAsync.prototype.getPerfStats = function() { | 274 remoting.ClientPluginAsync.prototype.getPerfStats = function() { |
| 290 return this.perfStats_; | 275 return this.perfStats_; |
| 291 }; | 276 }; |
| OLD | NEW |