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

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: Reviewer comments. 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
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | remoting/webapp/client_screen.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cb64329a379091fa3388af10a9c596fef3c278b5 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,20 @@ remoting.ClientPluginAsync.prototype.handleMessage_ = function(messageStr) {
var ready = /** @type {boolean} */ message.data['ready'];
this.onConnectionReadyHandler(ready);
} else if (message.method == 'fetchPin') {
- this.fetchPinHandler();
+ // The pairingSupported value in the dictionary indicates whether both
+ // client and host support pairing. If the client doesn't support pairing,
+ // then the value won't be there at all, so give it a default of false.
+ /** @type {boolean} */
+ var pairingSupported = false;
+ if ('pairingSupported' in message.data) {
+ pairingSupported =
+ /** @type {boolean} */ message.data['pairingSupported'];
+ if (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.');
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | remoting/webapp/client_screen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698