Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: remoting/webapp/client_plugin_async.js

Issue 15685008: Show a 'remember me' checkbox in the web-app when connecting to a host that supports pairing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved PIN dialog layout. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.');

Powered by Google App Engine
This is Rietveld 408576698