| 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 * Functions related to the 'client screen' for Chromoting. | 7 * Functions related to the 'client screen' for Chromoting. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 /** | 366 /** |
| 367 * Extension message handler. | 367 * Extension message handler. |
| 368 * | 368 * |
| 369 * @param {string} type The type of the extension message. | 369 * @param {string} type The type of the extension message. |
| 370 * @param {string} data The payload of the extension message. | 370 * @param {string} data The payload of the extension message. |
| 371 * @return {boolean} Return true if the extension message was recognized. | 371 * @return {boolean} Return true if the extension message was recognized. |
| 372 */ | 372 */ |
| 373 remoting.onExtensionMessage = function(type, data) { | 373 remoting.onExtensionMessage = function(type, data) { |
| 374 if (remoting.clientSession) { |
| 375 return remoting.clientSession.handleExtensionMessage(type, data); |
| 376 } |
| 374 return false; | 377 return false; |
| 375 }; | 378 }; |
| 376 | 379 |
| 377 /** | 380 /** |
| 378 * Create a session connector if one doesn't already exist. | 381 * Create a session connector if one doesn't already exist. |
| 379 */ | 382 */ |
| 380 remoting.ensureSessionConnector_ = function() { | 383 remoting.ensureSessionConnector_ = function() { |
| 381 if (!remoting.connector) { | 384 if (!remoting.connector) { |
| 382 remoting.connector = new remoting.SessionConnector( | 385 remoting.connector = new remoting.SessionConnector( |
| 383 document.getElementById('video-container'), | 386 document.getElementById('video-container'), |
| 384 remoting.onConnected, | 387 remoting.onConnected, |
| 385 showConnectError_, remoting.onExtensionMessage); | 388 showConnectError_, remoting.onExtensionMessage); |
| 386 } | 389 } |
| 387 }; | 390 }; |
| OLD | NEW |