Index: remoting/webapp/crd/js/desktop_connected_view.js |
diff --git a/remoting/webapp/crd/js/desktop_connected_view.js b/remoting/webapp/crd/js/desktop_connected_view.js |
index b40b63d183f29ecccffacc4e3edd407feccd9a1e..95a6f6d676908fe2be184c9c4ce449e3a5221e8d 100644 |
--- a/remoting/webapp/crd/js/desktop_connected_view.js |
+++ b/remoting/webapp/crd/js/desktop_connected_view.js |
@@ -31,12 +31,11 @@ remoting.enableMouseLock = false; |
* @param {remoting.DesktopConnectedView.Mode} mode The mode of this connection. |
* @param {string} defaultRemapKeys The default set of remap keys, to use |
* when the client doesn't define any. |
- * @param {function(remoting.Error, remoting.ClientPlugin): void} onInitialized |
* @constructor |
* @extends {base.EventSourceImpl} |
*/ |
remoting.DesktopConnectedView = function(session, container, host, mode, |
kelvinp
2015/03/06 02:58:37
I think we should create the DesktopConnectedView
garykac
2015/03/06 23:38:33
Done.
|
- defaultRemapKeys, onInitialized) { |
+ defaultRemapKeys) { |
this.session_ = session; |
/** @type {HTMLElement} @private */ |
@@ -54,12 +53,6 @@ remoting.DesktopConnectedView = function(session, container, host, mode, |
/** @type {string} @private */ |
this.defaultRemapKeys_ = defaultRemapKeys; |
- /** |
- * Called when the UI is finished initializing. |
- * @type {function(remoting.Error, remoting.ClientPlugin):void} |
- */ |
- this.onInitialized_ = onInitialized; |
- |
/** @private */ |
this.callPluginLostFocus_ = this.pluginLostFocus_.bind(this); |
/** @private */ |
@@ -154,40 +147,10 @@ remoting.DesktopConnectedView.prototype.getViewportForTesting = function() { |
}; |
/** |
- * Adds <embed> element to the UI container and readies the session object. |
- * |
- * @param {function(string, string):boolean} onExtensionMessage The handler for |
- * protocol extension messages. Returns true if a message is recognized; |
- * false otherwise. |
- * @param {Array<string>} requiredCapabilities A list of capabilities |
- * required by this application. |
- */ |
-remoting.DesktopConnectedView.prototype.createPluginAndConnect = |
- function(onExtensionMessage, requiredCapabilities) { |
- this.plugin_ = remoting.ClientPlugin.factory.createPlugin( |
- this.getPluginContainer_(), |
- onExtensionMessage, requiredCapabilities); |
- var that = this; |
- this.host_.options.load().then(function(){ |
- that.plugin_.initialize(that.onPluginInitialized_.bind(that)); |
- }); |
-}; |
- |
-/** |
- * @param {boolean} initialized |
- */ |
-remoting.DesktopConnectedView.prototype.onPluginInitialized_ = function( |
- initialized) { |
- if (!initialized) { |
- console.error('ERROR: remoting plugin not loaded'); |
- this.onInitialized_(remoting.Error.MISSING_PLUGIN, this.plugin_); |
- return; |
- } |
- |
- if (!this.plugin_.isSupportedVersion()) { |
- this.onInitialized_(remoting.Error.BAD_PLUGIN_VERSION, this.plugin_); |
- return; |
- } |
+ * @param {remoting.ClientPlugin} plugin |
+ */ |
+remoting.DesktopConnectedView.prototype.onPluginInitialized = function(plugin) { |
+ this.plugin_ = plugin; |
// Show the Send Keys menu only if the plugin has the injectKeyEvent feature, |
// and the Ctrl-Alt-Del button only in Me2Me mode. |
@@ -214,8 +177,6 @@ remoting.DesktopConnectedView.prototype.onPluginInitialized_ = function( |
} |
this.plugin_.setMouseCursorHandler(this.updateMouseCursorImage_.bind(this)); |
- |
- this.onInitialized_(remoting.Error.NONE, this.plugin_); |
}; |
/** |
@@ -265,7 +226,6 @@ remoting.DesktopConnectedView.prototype.removePlugin = function() { |
'focus', this.callPluginGotFocus_, false); |
this.plugin_.element().removeEventListener( |
'blur', this.callPluginLostFocus_, false); |
- this.plugin_.dispose(); |
this.plugin_ = null; |
} |