Chromium Code Reviews| Index: remoting/webapp/client_plugin_async.js |
| diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js |
| index 788b49afb83a589f2901275876f5f2711867796f..b123a9700910fa4b3f8ebb7a58005024b8bbf320 100644 |
| --- a/remoting/webapp/client_plugin_async.js |
| +++ b/remoting/webapp/client_plugin_async.js |
| @@ -50,7 +50,7 @@ remoting.ClientPluginAsync = function(plugin) { |
| this.onDesktopSizeUpdateHandler = function () {}; |
| /** @param {!Array.<string>} capabilities The negotiated capabilities. */ |
| this.onSetCapabilitiesHandler = function (capabilities) {}; |
| - this.fetchPinHandler = function () {}; |
| + this.fetchPinHandler = function (supportsPairing) {}; |
| /** @type {number} */ |
| this.pluginApiVersion_ = -1; |
| @@ -263,7 +263,14 @@ remoting.ClientPluginAsync.prototype.handleMessage_ = function(messageStr) { |
| var ready = /** @type {boolean} */ message.data['ready']; |
| this.onConnectionReadyHandler(ready); |
| } else if (message.method == 'fetchPin') { |
| - this.fetchPinHandler(); |
| + var pairingSupported = |
| + /** @type {boolean} */ message.data['pairingSupported']; |
| + if (pairingSupported !== undefined && |
|
rmsousa
2013/05/23 00:14:59
Nit: I think it's clearer to explicitly test for '
Jamie
2013/05/23 01:10:08
Done.
|
| + typeof pairingSupported != 'boolean') { |
| + console.error('Received incorrect fetchPin message.'); |
| + return; |
| + } |
| + this.fetchPinHandler(pairingSupported); |
| } else if (message.method == 'setCapabilities') { |
| if (typeof message.data['capabilities'] != 'string') { |
| console.error('Received incorrect setCapabilities message.'); |