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

Unified Diff: remoting/webapp/host_controller.js

Issue 340993002: Revert of Remove NPAPI plugin from chromoting webapp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/build-webapp.py ('k') | remoting/webapp/host_dispatcher.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_controller.js
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js
index 619abe3be8faf0715186d523f1fc06c335709998..70cf69e1caf9b2b342930f1fd881a7473d2a7823 100644
--- a/remoting/webapp/host_controller.js
+++ b/remoting/webapp/host_controller.js
@@ -68,8 +68,15 @@
* @private
*/
remoting.HostController.prototype.createDispatcher_ = function() {
+ /** @return {remoting.HostPlugin} */
+ var createPluginForMe2Me = function() {
+ /** @type {HTMLElement} @private */
+ var container = document.getElementById('daemon-plugin-container');
+ return remoting.createNpapiPlugin(container);
+ };
+
/** @type {remoting.HostDispatcher} @private */
- var hostDispatcher = new remoting.HostDispatcher();
+ var hostDispatcher = new remoting.HostDispatcher(createPluginForMe2Me);
/** @param {string} version */
var printVersion = function(version) {
@@ -116,6 +123,27 @@
*/
remoting.HostController.prototype.getConsent = function(onDone, onError) {
this.hostDispatcher_.getUsageStatsConsent(onDone, onError);
+};
+
+/**
+ * @param {function(remoting.HostController.AsyncResult):void} onDone
+ * @param {function(remoting.Error):void} onError
+ * @return {void}
+ */
+remoting.HostController.prototype.installHost = function(onDone, onError) {
+ /** @type {remoting.HostController} */
+ var that = this;
+
+ /** @param {remoting.HostController.AsyncResult} asyncResult */
+ var onHostInstalled = function(asyncResult) {
+ // Refresh the dispatcher after the host has been installed.
+ if (asyncResult == remoting.HostController.AsyncResult.OK) {
+ that.hostDispatcher_ = that.createDispatcher_();
+ }
+ onDone(asyncResult);
+ };
+
+ this.hostDispatcher_.installHost(onHostInstalled, onError);
};
/**
@@ -502,5 +530,13 @@
this.hostDispatcher_.clearPairedClients(onDone, onError);
};
+/**
+ * Returns true if the NPAPI plugin is being used.
+ * @return {boolean}
+ */
+remoting.HostController.prototype.usingNpapiPlugin = function() {
+ return this.hostDispatcher_.usingNpapiPlugin();
+}
+
/** @type {remoting.HostController} */
remoting.hostController = null;
« no previous file with comments | « remoting/webapp/build-webapp.py ('k') | remoting/webapp/host_dispatcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698