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

Unified Diff: remoting/webapp/client_plugin_async.js

Issue 12867004: Webapp changes to support asking for a PIN (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 9 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 bdda43331a69d334967aad471c8d37269c704256..e9b1f6564bb65678d8433516493f0eb0caa44f77 100644
--- a/remoting/webapp/client_plugin_async.js
+++ b/remoting/webapp/client_plugin_async.js
@@ -41,6 +41,7 @@ remoting.ClientPluginAsync = function(plugin) {
/** @param {boolean} ready Connection ready state. */
this.onConnectionReadyHandler = function(ready) {};
this.onDesktopSizeUpdateHandler = function () {};
+ this.fetchPinHandler = function () {};
/** @type {number} */
this.pluginApiVersion_ = -1;
@@ -205,8 +206,10 @@ remoting.ClientPluginAsync.prototype.handleMessage_ = function(messageStr) {
}
var ready = /** @type {boolean} */ message.data['ready'];
this.onConnectionReadyHandler(ready);
+ } else if (message.method == 'fetchPin') {
+ this.fetchPinHandler();
}
-}
+};
/**
* Deletes the plugin.
@@ -435,6 +438,32 @@ remoting.ClientPluginAsync.prototype.pauseAudio =
};
/**
+ * Called when a PIN is obtained from the user.
+ *
+ * @param {string} pin The PIN.
+ */
+remoting.ClientPluginAsync.prototype.onPinFetched =
+ function(pin) {
+ if (!this.hasFeature(remoting.ClientPlugin.Feature.ASYNC_PIN)) {
+ return;
+ }
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'onPinFetched', data: { pin: pin }}));
+};
+
+/**
+ * Tells the plugin to ask for the PIN asynchronously.
+ */
+remoting.ClientPluginAsync.prototype.useAsyncPinDialog =
+ function() {
+ if (!this.hasFeature(remoting.ClientPlugin.Feature.ASYNC_PIN)) {
+ return;
+ }
+ this.plugin.postMessage(JSON.stringify(
+ { method: 'useAsyncPinDialog', data: {} }));
+};
+
+/**
* If we haven't yet received a "hello" message from the plugin, change its
* size so that the user can confirm it if click-to-play is enabled, or can
* see the "this plugin is disabled" message if it is actually disabled.
« 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