summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
authorkelvinp <kelvinp@chromium.org>2015-04-20 11:52:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-20 18:52:12 +0000
commit2c5de34072226c91d465349cb249d76d16387bef (patch)
treea44aab1e70097eefdbb71171a19f7f776530dee6 /remoting/webapp
parent85e13090e8ec1020827a68b3309ac8fb93886a75 (diff)
downloadchromium_src-2c5de34072226c91d465349cb249d76d16387bef.zip
chromium_src-2c5de34072226c91d465349cb249d76d16387bef.tar.gz
chromium_src-2c5de34072226c91d465349cb249d76d16387bef.tar.bz2
[Webapp Refactor] Remove remoting.SessionConnector.
This is a reland of crrev.com/1047413006 remoting.SessionConnector is currently responsible for creating the plugin, the signal strategy and the clientSession. It also magically disposes the plugin when the clientSession finishes. However, the session is not exposed to the caller elsewhere, which makes it hard for the caller to dispose of the session before it is connected, e.g. Cancel a PIN entry. It is currently a stateful object that keeps track of the host, credentials provider, strategy of the created session, which is redundant. This CL 1. Offloads the creation of the clientSession to the remoting.ClientSessionFactory. It also allow the caller to configure a clientSession prior to connecting. The remoting.ClientSessionFactory is essentially stateless except for a few predefined ClientSession construction parameters. 2. Allow the caller to have a different instance of ClientSession.EventHandler for each instance ClientSession created. 3. Revives remoting.MockClientPlugin and uses it for remoting.ClientSessionFactory unittests. Ownership graph before: Activity -> SessionConenctor -> ClientSession Ownership graph after: Activity -> ClientSession TBR=jamiewalch BUG=477522 TEST=All browser tests passed on https://chromium-swarm.appspot.com/user/tasks?sort=created_ts&state=all&limit=10&task_name=chromoting_integration_tests Review URL: https://codereview.chromium.org/1097133002 Cr-Commit-Position: refs/heads/master@{#325887}
Diffstat (limited to 'remoting/webapp')
-rw-r--r--remoting/webapp/app_remoting/js/app_remoting_activity.js24
-rw-r--r--remoting/webapp/base/js/application.js2
-rw-r--r--remoting/webapp/base/js/protocol_extension.js2
-rw-r--r--remoting/webapp/crd/js/client_session.js98
-rw-r--r--remoting/webapp/crd/js/client_session_factory.js134
-rw-r--r--remoting/webapp/crd/js/client_session_factory_unittest.js100
-rw-r--r--remoting/webapp/crd/js/desktop_remoting_activity.js26
-rw-r--r--remoting/webapp/crd/js/it2me_activity.js10
-rw-r--r--remoting/webapp/crd/js/me2me_activity.js11
-rw-r--r--remoting/webapp/crd/js/mock_client_plugin.js92
-rw-r--r--remoting/webapp/crd/js/mock_session_connector.js171
-rw-r--r--remoting/webapp/crd/js/session_connector.js52
-rw-r--r--remoting/webapp/crd/js/session_connector_impl.js291
-rw-r--r--remoting/webapp/files.gni5
14 files changed, 419 insertions, 599 deletions
diff --git a/remoting/webapp/app_remoting/js/app_remoting_activity.js b/remoting/webapp/app_remoting/js/app_remoting_activity.js
index 3685946..fecd55d 100644
--- a/remoting/webapp/app_remoting/js/app_remoting_activity.js
+++ b/remoting/webapp/app_remoting/js/app_remoting_activity.js
@@ -35,9 +35,9 @@ remoting.AppRemotingActivity = function(appCapabilities) {
this.connectedView_ = null;
/** @private */
- this.connector_ = remoting.SessionConnector.factory.createConnector(
- document.getElementById('client-container'), appCapabilities,
- this);
+ this.sessionFactory_ = new remoting.ClientSessionFactory(
+ document.querySelector('#client-container .client-plugin-container'),
+ appCapabilities);
/** @private {remoting.ClientSession} */
this.session_ = null;
@@ -69,6 +69,7 @@ remoting.AppRemotingActivity.prototype.stop = function() {
remoting.AppRemotingActivity.prototype.cleanup_ = function() {
base.dispose(this.connectedView_);
this.connectedView_ = null;
+ base.dispose(this.session_);
this.session_ = null;
};
@@ -127,11 +128,17 @@ remoting.AppRemotingActivity.prototype.onAppHostResponse_ =
host['sharedSecret']);
};
- this.connector_.connect(
- remoting.Application.Mode.APP_REMOTING, host,
- new remoting.CredentialsProvider(
- {fetchThirdPartyToken: fetchThirdPartyToken}));
-
+ remoting.app.setConnectionMode(remoting.Application.Mode.APP_REMOTING);
+ var credentialsProvider = new remoting.CredentialsProvider(
+ {fetchThirdPartyToken: fetchThirdPartyToken});
+ var that = this;
+
+ this.sessionFactory_.createSession(this).then(
+ function(/** remoting.ClientSession */ session) {
+ that.session_ = session;
+ session.logHostOfflineErrors(true);
+ session.connect(host, credentialsProvider);
+ });
} else if (response && response.status == 'pending') {
this.onError(new remoting.Error(
remoting.Error.Tag.SERVICE_UNAVAILABLE));
@@ -149,7 +156,6 @@ remoting.AppRemotingActivity.prototype.onConnected = function(connectionInfo) {
this.connectedView_ = new remoting.AppConnectedView(
document.getElementById('client-container'), connectionInfo);
- this.session_ = connectionInfo.session();
var idleDetector = new remoting.IdleDetector(
document.getElementById('idle-dialog'), this.stop.bind(this));
diff --git a/remoting/webapp/base/js/application.js b/remoting/webapp/base/js/application.js
index 63cafa0..48a4f61 100644
--- a/remoting/webapp/base/js/application.js
+++ b/remoting/webapp/base/js/application.js
@@ -25,8 +25,6 @@ remoting.testEvents;
remoting.Application = function() {
// Create global factories.
remoting.ClientPlugin.factory = new remoting.DefaultClientPluginFactory();
- remoting.SessionConnector.factory =
- new remoting.DefaultSessionConnectorFactory();
/** @protected {remoting.Application.Mode} */
this.connectionMode_ = remoting.Application.Mode.ME2ME;
diff --git a/remoting/webapp/base/js/protocol_extension.js b/remoting/webapp/base/js/protocol_extension.js
index 28103f7..11d8aa6 100644
--- a/remoting/webapp/base/js/protocol_extension.js
+++ b/remoting/webapp/base/js/protocol_extension.js
@@ -5,7 +5,7 @@
/**
* @fileoverview
* Interface abstracting the protocol extension functionality.
- * Instances of this class can be registered with the SessionConnector
+ * Instances of this class can be registered with the ProtocolExtensionManager
* to enhance the communication protocol between the host and client.
* Note that corresponding support on the host side is required.
*/
diff --git a/remoting/webapp/crd/js/client_session.js b/remoting/webapp/crd/js/client_session.js
index f76069e..b31d69f 100644
--- a/remoting/webapp/crd/js/client_session.js
+++ b/remoting/webapp/crd/js/client_session.js
@@ -8,9 +8,8 @@
*
* The ClientSession class controls lifetime of the client plugin
* object and provides the plugin with the functionality it needs to
- * establish connection. Specifically it:
- * - Delivers incoming/outgoing signaling messages,
- * - Adjusts plugin size and position when destop resolution changes,
+ * establish connection, e.g. delivers incoming/outgoing signaling
+ * messages.
*
* This class should not access the plugin directly, instead it should
* do it through ClientPlugin class which abstracts plugin version
@@ -24,15 +23,15 @@ var remoting = remoting || {};
/**
* @param {remoting.ClientPlugin} plugin
- * @param {remoting.Host} host The host to connect to.
* @param {remoting.SignalStrategy} signalStrategy Signal strategy.
+ * @param {remoting.ClientSession.EventHandler} listener
*
* @constructor
* @extends {base.EventSourceImpl}
* @implements {base.Disposable}
* @implements {remoting.ClientPlugin.ConnectionEventHandler}
*/
-remoting.ClientSession = function(plugin, host, signalStrategy) {
+remoting.ClientSession = function(plugin, signalStrategy, listener) {
base.inherits(this, base.EventSourceImpl);
/** @private */
@@ -41,13 +40,19 @@ remoting.ClientSession = function(plugin, host, signalStrategy) {
/** @private {!remoting.Error} */
this.error_ = remoting.Error.none();
- /** @private */
- this.host_ = host;
+ /** @private {remoting.Host} */
+ this.host_ = null;
+
+ /** @private {remoting.CredentialsProvider} */
+ this.credentialsProvider_ = null;
/** @private */
this.sessionId_ = '';
/** @private */
+ this.listener_ = listener;
+
+ /** @private */
this.hasReceivedFrame_ = false;
this.logToServer = new remoting.LogToServer(signalStrategy);
@@ -58,9 +63,8 @@ remoting.ClientSession = function(plugin, host, signalStrategy) {
this.signalStrategy_.setIncomingStanzaCallback(
this.onIncomingMessage_.bind(this));
- /** @private */
- this.iqFormatter_ =
- new remoting.FormatIq(this.signalStrategy_.getJid(), host.jabberId);
+ /** @private {remoting.FormatIq} */
+ this.iqFormatter_ = null;
/**
* Allow host-offline error reporting to be suppressed in situations where it
@@ -255,6 +259,21 @@ remoting.ClientSession.Capability = {
};
/**
+ * Connects to |host| using |credentialsProvider| as the credentails.
+ *
+ * @param {remoting.Host} host
+ * @param {remoting.CredentialsProvider} credentialsProvider
+ */
+remoting.ClientSession.prototype.connect = function(host, credentialsProvider) {
+ this.host_ = host;
+ this.credentialsProvider_ = credentialsProvider;
+ this.iqFormatter_ =
+ new remoting.FormatIq(this.signalStrategy_.getJid(), host.jabberId);
+ this.plugin_.connect(this.host_, this.signalStrategy_.getJid(),
+ credentialsProvider);
+};
+
+/**
* Disconnect the current session with a particular |error|. The session will
* raise a |stateChanged| event in response to it. The caller should then call
* dispose() to remove and destroy the <embed> element.
@@ -297,6 +316,7 @@ remoting.ClientSession.prototype.disconnect = function(error) {
remoting.ClientSession.prototype.dispose = function() {
base.dispose(this.connectedDisposables_);
this.connectedDisposables_ = null;
+ base.dispose(this.plugin_);
this.plugin_ = null;
};
@@ -488,7 +508,65 @@ remoting.ClientSession.prototype.setState_ = function(newState) {
this.connectedDisposables_ = null;
}
+ this.notifyStateChanges_(oldState, this.state_);
this.logToServer.logClientSessionStateChange(this.state_, this.error_);
+};
+
+/**
+ * @param {remoting.ClientSession.State} oldState The new state for the session.
+ * @param {remoting.ClientSession.State} newState The new state for the session.
+ * @private
+ */
+remoting.ClientSession.prototype.notifyStateChanges_ =
+ function(oldState, newState) {
+ /** @type {remoting.Error} */
+ var error;
+ switch (this.state_) {
+ case remoting.ClientSession.State.CONNECTED:
+ console.log('Connection established.');
+ var connectionInfo = new remoting.ConnectionInfo(
+ this.host_, this.credentialsProvider_, this, this.plugin_);
+ this.listener_.onConnected(connectionInfo);
+ break;
+
+ case remoting.ClientSession.State.CONNECTING:
+ remoting.identity.getEmail().then(function(/** string */ email) {
+ console.log('Connecting as ' + email);
+ });
+ break;
+
+ case remoting.ClientSession.State.AUTHENTICATED:
+ console.log('Connection authenticated.');
+ break;
+
+ case remoting.ClientSession.State.INITIALIZING:
+ console.log('Connection initializing .');
+ break;
+
+ case remoting.ClientSession.State.CLOSED:
+ console.log('Connection closed.');
+ this.listener_.onDisconnected();
+ break;
+
+ case remoting.ClientSession.State.FAILED:
+ error = this.getError();
+ console.error('Connection failed: ' + error.toString());
+ this.listener_.onConnectionFailed(error);
+ break;
+
+ case remoting.ClientSession.State.CONNECTION_DROPPED:
+ error = this.getError();
+ console.error('Connection dropped: ' + error.toString());
+ this.listener_.onError(error);
+ break;
+
+ default:
+ console.error('Unexpected client plugin state: ' + newState);
+ // This should only happen if the web-app and client plugin get out of
+ // sync, and even then the version check should ensure compatibility.
+ this.listener_.onError(
+ new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
+ }
this.raiseEvent(remoting.ClientSession.Events.stateChanged,
new remoting.ClientSession.StateEvent(newState, oldState)
diff --git a/remoting/webapp/crd/js/client_session_factory.js b/remoting/webapp/crd/js/client_session_factory.js
new file mode 100644
index 0000000..24cfa2a
--- /dev/null
+++ b/remoting/webapp/crd/js/client_session_factory.js
@@ -0,0 +1,134 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/** @suppress {duplicate} */
+var remoting = remoting || {};
+
+(function() {
+
+'use strict';
+
+/**
+ * @param {Element} container parent element for the plugin to be created.
+ * @param {Array<string>} capabilities capabilities required by this
+ * application.
+ * @constructor
+ */
+remoting.ClientSessionFactory = function(container, capabilities) {
+ /** @private */
+ this.container_ = /** @type {HTMLElement} */ (container);
+
+ /** @private {Array<string>} */
+ this.requiredCapabilities_ = [
+ remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION,
+ remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS,
+ remoting.ClientSession.Capability.VIDEO_RECORDER
+ ];
+
+ // Append the app-specific capabilities.
+ this.requiredCapabilities_.push.apply(this.requiredCapabilities_,
+ capabilities);
+};
+
+/**
+ * Creates a session.
+ *
+ * @param {remoting.ClientSession.EventHandler} listener
+ * @return {Promise<!remoting.ClientSession>} Resolves with the client session
+ * if succeeded or rejects with remoting.Error on failure.
+ */
+remoting.ClientSessionFactory.prototype.createSession = function(listener) {
+ var that = this;
+ /** @type {string} */
+ var token;
+ /** @type {remoting.SignalStrategy} */
+ var signalStrategy;
+ /** @type {remoting.ClientPlugin} */
+ var clientPlugin;
+
+ function OnError(/** remoting.Error */ error) {
+ base.dispose(signalStrategy);
+ base.dispose(clientPlugin);
+ throw error;
+ }
+
+ var promise = remoting.identity.getToken().then(
+ function(/** string */ authToken) {
+ token = authToken;
+ return remoting.identity.getUserInfo();
+ }).then(function(/** {email: string, name: string} */ userInfo) {
+ return connectSignaling(userInfo.email, token);
+ }).then(function(/** remoting.SignalStrategy */ strategy) {
+ signalStrategy = strategy;
+ return createPlugin(that.container_, that.requiredCapabilities_);
+ }).then(function(/** remoting.ClientPlugin */ plugin) {
+ clientPlugin = plugin;
+ return new remoting.ClientSession(plugin, signalStrategy, listener);
+ }).catch(
+ remoting.Error.handler(OnError)
+ );
+
+ return /** @type {Promise<!remoting.ClientSession>} */ (promise);
+};
+
+/**
+ * @param {string} email
+ * @param {string} token
+ * @return {Promise<!remoting.SignalStrategy>}
+ */
+function connectSignaling(email, token) {
+ var signalStrategy = remoting.SignalStrategy.create();
+ var deferred = new base.Deferred();
+ function onSignalingState(/** remoting.SignalStrategy.State */ state) {
+ switch (state) {
+ case remoting.SignalStrategy.State.CONNECTED:
+ deferred.resolve(signalStrategy);
+ break;
+
+ case remoting.SignalStrategy.State.FAILED:
+ var error = signalStrategy.getError();
+ signalStrategy.dispose();
+ deferred.reject(error);
+ break;
+ }
+ }
+ signalStrategy.setStateChangedCallback(onSignalingState);
+ signalStrategy.connect(remoting.settings.XMPP_SERVER, email, token);
+ return deferred.promise();
+}
+
+/**
+ * Creates the plugin.
+ * @param {HTMLElement} container parent element for the plugin.
+ * @param {Array<string>} capabilities capabilities required by this
+ * application.
+ * @return {Promise<!remoting.ClientPlugin>}
+ */
+function createPlugin(container, capabilities) {
+ var plugin = remoting.ClientPlugin.factory.createPlugin(
+ container, capabilities);
+ var deferred = new base.Deferred();
+
+ function onInitialized(/** boolean */ initialized) {
+ if (!initialized) {
+ console.error('ERROR: remoting plugin not loaded');
+ plugin.dispose();
+ deferred.reject(new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
+ return;
+ }
+
+ if (!plugin.isSupportedVersion()) {
+ console.error('ERROR: bad plugin version');
+ plugin.dispose();
+ deferred.reject(
+ new remoting.Error(remoting.Error.Tag.BAD_PLUGIN_VERSION));
+ return;
+ }
+ deferred.resolve(plugin);
+ }
+ plugin.initialize(onInitialized);
+ return deferred.promise();
+}
+
+})();
diff --git a/remoting/webapp/crd/js/client_session_factory_unittest.js b/remoting/webapp/crd/js/client_session_factory_unittest.js
new file mode 100644
index 0000000..f0e884c
--- /dev/null
+++ b/remoting/webapp/crd/js/client_session_factory_unittest.js
@@ -0,0 +1,100 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+(function() {
+
+'use strict';
+
+var originalPluginFactory;
+var originalIdentity;
+var originalSettings;
+
+/** @type {remoting.MockSignalStrategy} */
+var mockSignalStrategy;
+/** @type {remoting.ClientSessionFactory} */
+var factory;
+/** @type {remoting.ClientSession.EventHandler} */
+var listener;
+/** @type {sinon.TestStub} */
+var createSignalStrategyStub;
+
+/**
+ * @constructor
+ * @implements {remoting.ClientSession.EventHandler}
+ */
+var SessionListener = function() {};
+SessionListener.prototype.onConnectionFailed = function(error) {};
+SessionListener.prototype.onConnected = function(connectionInfo) {};
+SessionListener.prototype.onDisconnected = function() {};
+SessionListener.prototype.onError = function(error) {};
+
+QUnit.module('ClientSessionFactory', {
+ beforeEach: function() {
+ originalPluginFactory = remoting.ClientPlugin.factory;
+ remoting.ClientPlugin.factory = new remoting.MockClientPluginFactory();
+
+ mockSignalStrategy = new remoting.MockSignalStrategy(
+ 'jid', remoting.SignalStrategy.Type.XMPP);
+ createSignalStrategyStub = sinon.stub(remoting.SignalStrategy, 'create');
+ createSignalStrategyStub.returns(mockSignalStrategy);
+ listener = new SessionListener();
+
+ originalIdentity = remoting.identity;
+ remoting.identity = new remoting.Identity();
+ chromeMocks.activate(['identity']);
+ chromeMocks.identity.mock$setToken('fake_token');
+
+ originalSettings = remoting.settings;
+ remoting.settings = new remoting.Settings();
+
+ remoting.identity.getUserInfo = function() {
+ return { email: 'email', userName: 'userName'};
+ };
+
+ factory = new remoting.ClientSessionFactory(
+ document.createElement('div'), ['fake_capability']);
+ },
+ afterEach: function() {
+ remoting.settings = originalSettings;
+ remoting.identity = originalIdentity;
+ chromeMocks.restore();
+ remoting.identity = null;
+ remoting.ClientPlugin.factory = originalPluginFactory;
+ createSignalStrategyStub.restore();
+ }
+});
+
+QUnit.test('createSession() should return a remoting.ClientSession',
+ function(assert) {
+
+ mockSignalStrategy.connect = function() {
+ mockSignalStrategy.setStateForTesting(
+ remoting.SignalStrategy.State.CONNECTED);
+ };
+
+ return factory.createSession(listener).then(
+ function(/** remoting.ClientSession */ session){
+ assert.ok(session instanceof remoting.ClientSession);
+ });
+});
+
+QUnit.test('createSession() should reject on signal strategy failure',
+ function(assert) {
+
+ mockSignalStrategy.connect = function() {
+ mockSignalStrategy.setStateForTesting(remoting.SignalStrategy.State.FAILED);
+ };
+
+ var signalStrategyDispose =
+ /** @type {sinon.Spy} */ (sinon.spy(mockSignalStrategy, 'dispose'));
+
+ return factory.createSession(listener).then(
+ assert.ok.bind(assert, false, 'Expect createSession to fail')
+ ).catch(function(/** remoting.Error */ error) {
+ assert.ok(signalStrategyDispose.called);
+ assert.equal(error.getDetail(), 'setStateForTesting');
+ });
+});
+
+})();
diff --git a/remoting/webapp/crd/js/desktop_remoting_activity.js b/remoting/webapp/crd/js/desktop_remoting_activity.js
index 369b228..1e64621 100644
--- a/remoting/webapp/crd/js/desktop_remoting_activity.js
+++ b/remoting/webapp/crd/js/desktop_remoting_activity.js
@@ -24,10 +24,33 @@ remoting.DesktopRemotingActivity = function(parentActivity) {
this.parentActivity_ = parentActivity;
/** @private {remoting.DesktopConnectedView} */
this.connectedView_ = null;
+ /** @private */
+ this.sessionFactory_ = new remoting.ClientSessionFactory(
+ document.querySelector('#client-container .client-plugin-container'),
+ remoting.app_capabilities());
/** @private {remoting.ClientSession} */
this.session_ = null;
};
+/**
+ * Initiates a connection.
+ *
+ * @param {remoting.Host} host the Host to connect to.
+ * @param {remoting.CredentialsProvider} credentialsProvider
+ * @param {boolean=} opt_suppressOfflineError
+ * @return {void} Nothing.
+ */
+remoting.DesktopRemotingActivity.prototype.start =
+ function(host, credentialsProvider, opt_suppressOfflineError) {
+ var that = this;
+ this.sessionFactory_.createSession(this).then(
+ function(/** remoting.ClientSession */ session) {
+ that.session_ = session;
+ session.logHostOfflineErrors(!opt_suppressOfflineError);
+ session.connect(host, credentialsProvider);
+ });
+};
+
remoting.DesktopRemotingActivity.prototype.stop = function() {
if (this.session_) {
this.session_.disconnect(remoting.Error.none());
@@ -46,8 +69,6 @@ remoting.DesktopRemotingActivity.prototype.onConnected =
remoting.toolbar.preview();
}
- this.session_ = connectionInfo.session();
-
this.connectedView_ = new remoting.DesktopConnectedView(
document.getElementById('client-container'), connectionInfo);
@@ -100,6 +121,7 @@ remoting.DesktopRemotingActivity.prototype.onError = function(error) {
remoting.DesktopRemotingActivity.prototype.dispose = function() {
base.dispose(this.connectedView_);
this.connectedView_ = null;
+ base.dispose(this.session_);
this.session_ = null;
};
diff --git a/remoting/webapp/crd/js/it2me_activity.js b/remoting/webapp/crd/js/it2me_activity.js
index 4ee50c3..e5dc2db 100644
--- a/remoting/webapp/crd/js/it2me_activity.js
+++ b/remoting/webapp/crd/js/it2me_activity.js
@@ -185,13 +185,9 @@ remoting.It2MeActivity.prototype.onHostInfo_ = function(xhrResponse) {
remoting.It2MeActivity.prototype.connect_ = function(host) {
base.dispose(this.desktopActivity_);
this.desktopActivity_ = new remoting.DesktopRemotingActivity(this);
- var sessionConnector = remoting.SessionConnector.factory.createConnector(
- document.getElementById('client-container'),
- remoting.app_capabilities(),
- this.desktopActivity_);
- sessionConnector.connect(
- remoting.Application.Mode.IT2ME, host,
- new remoting.CredentialsProvider({ accessCode: this.passCode_ }));
+ remoting.app.setConnectionMode(remoting.Application.Mode.IT2ME);
+ this.desktopActivity_.start(
+ host, new remoting.CredentialsProvider({ accessCode: this.passCode_ }));
};
/**
diff --git a/remoting/webapp/crd/js/me2me_activity.js b/remoting/webapp/crd/js/me2me_activity.js
index 7f91246..7d2b090 100644
--- a/remoting/webapp/crd/js/me2me_activity.js
+++ b/remoting/webapp/crd/js/me2me_activity.js
@@ -72,14 +72,9 @@ remoting.Me2MeActivity.prototype.connect_ = function(suppressHostOfflineError) {
remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
base.dispose(this.desktopActivity_);
this.desktopActivity_ = new remoting.DesktopRemotingActivity(this);
- var connector = remoting.SessionConnector.factory.createConnector(
- document.getElementById('client-container'),
- remoting.app_capabilities(),
- this.desktopActivity_);
-
- connector.connect(
- remoting.Application.Mode.ME2ME,
- this.host_, this.createCredentialsProvider_(), suppressHostOfflineError);
+ remoting.app.setConnectionMode(remoting.Application.Mode.ME2ME);
+ this.desktopActivity_.start(this.host_, this.createCredentialsProvider_(),
+ suppressHostOfflineError);
};
/**
diff --git a/remoting/webapp/crd/js/mock_client_plugin.js b/remoting/webapp/crd/js/mock_client_plugin.js
index 965e213..6980147 100644
--- a/remoting/webapp/crd/js/mock_client_plugin.js
+++ b/remoting/webapp/crd/js/mock_client_plugin.js
@@ -5,7 +5,6 @@
/**
* @fileoverview
* Mock implementation of ClientPlugin for testing.
- * @suppress {checkTypes}
*/
'use strict';
@@ -20,12 +19,22 @@ var remoting = remoting || {};
*/
remoting.MockClientPlugin = function(container) {
this.container_ = container;
- this.element_ = document.createElement('div');
+ this.element_ = /** @type {HTMLElement} */ (document.createElement('div'));
this.element_.style.backgroundImage = 'linear-gradient(45deg, blue, red)';
- this.connectionStatusUpdateHandler_ = null;
- this.desktopSizeUpdateHandler_ = null;
this.container_.appendChild(this.element_);
this.hostDesktop_ = new remoting.MockClientPlugin.HostDesktop();
+ this.extensions_ = new remoting.ProtocolExtensionManager(base.doNothing);
+ /** @type {remoting.ClientPlugin.ConnectionEventHandler} */
+ this.connectionEventHandler = null;
+
+ // Fake initialization result to return.
+ this.mock$initializationResult = true;
+
+ // Fake capabilities to return.
+ this.mock$capabilities = [
+ remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION,
+ remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS
+ ];
};
remoting.MockClientPlugin.prototype.dispose = function() {
@@ -34,6 +43,10 @@ remoting.MockClientPlugin.prototype.dispose = function() {
this.connectionStatusUpdateHandler_ = null;
};
+remoting.MockClientPlugin.prototype.extensions = function() {
+ return this.extensions_;
+};
+
remoting.MockClientPlugin.prototype.hostDesktop = function() {
return this.hostDesktop_;
};
@@ -43,24 +56,31 @@ remoting.MockClientPlugin.prototype.element = function() {
};
remoting.MockClientPlugin.prototype.initialize = function(onDone) {
- window.setTimeout(onDone.bind(null, true), 0);
+ var that = this;
+ Promise.resolve().then(function() {
+ onDone(that.mock$initializationResult);
+ });
};
remoting.MockClientPlugin.prototype.connect =
function(host, localJid, credentialsProvider) {
- base.debug.assert(this.connectionStatusUpdateHandler_ != null);
- window.setTimeout(
- this.connectionStatusUpdateHandler_.bind(
- this,
+ base.debug.assert(this.connectionEventHandler !== null);
+ var that = this;
+ window.requestAnimationFrame(function() {
+ that.connectionEventHandler.onConnectionStatusUpdate(
remoting.ClientSession.State.CONNECTED,
- remoting.ClientSession.ConnectionError.NONE),
- 0);
+ remoting.ClientSession.ConnectionError.NONE);
+ });
};
+remoting.MockClientPlugin.prototype.injectKeyCombination = function(keys) {};
+
remoting.MockClientPlugin.prototype.injectKeyEvent =
function(key, down) {};
+remoting.MockClientPlugin.prototype.setRemapKeys = function(remappings) {};
+
remoting.MockClientPlugin.prototype.remapKey = function(from, to) {};
remoting.MockClientPlugin.prototype.releaseAllKeys = function() {};
@@ -75,12 +95,18 @@ remoting.MockClientPlugin.prototype.hasFeature = function(feature) {
return false;
};
+remoting.MockClientPlugin.prototype.hasCapability = function(capability) {
+ return this.mock$capabilities.indexOf(capability) !== -1;
+};
+
remoting.MockClientPlugin.prototype.sendClipboardItem =
function(mimeType, item) {};
remoting.MockClientPlugin.prototype.requestPairing =
function(clientName, onDone) {};
+remoting.MockClientPlugin.prototype.allowMouseLock = function() {};
+
remoting.MockClientPlugin.prototype.pauseAudio = function(pause) {};
remoting.MockClientPlugin.prototype.pauseVideo = function(pause) {};
@@ -97,41 +123,17 @@ remoting.MockClientPlugin.prototype.getPerfStats = function() {
return result;
};
-remoting.MockClientPlugin.prototype.sendClientMessage =
- function(name, data) {};
-
-remoting.MockClientPlugin.prototype.setOnOutgoingIqHandler =
- function(handler) {};
-
-remoting.MockClientPlugin.prototype.setOnDebugMessageHandler =
- function(handler) {};
-
-/**
- * @param {function(number, number):void} handler
- * @private
- */
-remoting.MockClientPlugin.prototype.setConnectionStatusUpdateHandler =
+remoting.MockClientPlugin.prototype.setConnectionEventHandler =
function(handler) {
- /** @type {function(number, number):void} */
- this.connectionStatusUpdateHandler_ = handler;
+ this.connetionEventHandler = handler;
};
-remoting.MockClientPlugin.prototype.setRouteChangedHandler =
- function(handler) {};
-
-remoting.MockClientPlugin.prototype.setConnectionReadyHandler =
- function(handler) {};
-
-remoting.MockClientPlugin.prototype.setCapabilitiesHandler =
- function(handler) {};
-
-remoting.MockClientPlugin.prototype.setGnubbyAuthHandler =
+remoting.MockClientPlugin.prototype.setMouseCursorHandler =
function(handler) {};
-remoting.MockClientPlugin.prototype.setCastExtensionHandler =
- function(handler) {};
+remoting.MockClientPlugin.prototype.setClipboardHandler = function(handler) {};
-remoting.MockClientPlugin.prototype.setMouseCursorHandler =
+remoting.MockClientPlugin.prototype.setDebugDirtyRegionHandler =
function(handler) {};
/**
@@ -192,13 +194,17 @@ remoting.MockClientPlugin.HostDesktop.prototype.resize =
/**
* @constructor
- * @extends {remoting.ClientPluginFactory}
+ * @implements {remoting.ClientPluginFactory}
*/
-remoting.MockClientPluginFactory = function() {};
+remoting.MockClientPluginFactory = function() {
+ /** @private {remoting.MockClientPlugin} */
+ this.plugin_ = null;
+};
remoting.MockClientPluginFactory.prototype.createPlugin =
function(container, onExtensionMessage) {
- return new remoting.MockClientPlugin(container);
+ this.plugin_ = new remoting.MockClientPlugin(container);
+ return this.plugin_;
};
remoting.MockClientPluginFactory.prototype.preloadPlugin = function() {};
diff --git a/remoting/webapp/crd/js/mock_session_connector.js b/remoting/webapp/crd/js/mock_session_connector.js
deleted file mode 100644
index ae7d184..0000000
--- a/remoting/webapp/crd/js/mock_session_connector.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * Mock implementation of SessionConnector for testing.
- * @suppress {checkTypes}
- */
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-/**
- * @param {HTMLElement} clientContainer Container element for the client view.
- * @param {function(remoting.ClientSession):void} onConnected Callback on
- * success.
- * @param {function(!remoting.Error):void} onError Callback on error.
- * @param {function(string, string):boolean} onExtensionMessage The handler for
- * protocol extension messages. Returns true if a message is recognized;
- * false otherwise.
- * @param {function(!remoting.Error):void} onConnectionFailed Callback for when
- * the connection fails.
- * @param {Array<string>} requiredCapabilities Connector capabilities
- * required by this application.
- * @param {string} defaultRemapKeys The default set of key mappings for the
- * client session to use.
- * @constructor
- * @implements {remoting.SessionConnector}
- */
-remoting.MockSessionConnector = function(clientContainer, onConnected, onError,
- onExtensionMessage,
- onConnectionFailed,
- requiredCapabilities,
- defaultRemapKeys) {
- this.clientContainer_ = clientContainer;
- /** @type {function(remoting.ClientSession):void} */
- this.onConnected_ = onConnected;
- this.onError = onError;
- this.onExtensionMessage_ = onExtensionMessage;
- this.onConnectionFailed_ = onConnectionFailed;
- this.requiredCapabilities_ = requiredCapabilities;
- this.defaultRemapKeys_ = defaultRemapKeys;
-
- this.reset();
-};
-
-remoting.MockSessionConnector.prototype.reset = function() {
- /** @type {string} @private */
- this.hostId_ = '';
-};
-
-remoting.MockSessionConnector.prototype.connectMe2Me =
- function(host, fetchPin, fetchThirdPartyToken,
- clientPairingId, clientPairedSecret) {
- this.connect_();
-};
-
-remoting.MockSessionConnector.prototype.retryConnectMe2Me =
- function(host, fetchPin, fetchThirdPartyToken,
- clientPairingId, clientPairedSecret) {
- this.connect_();
-};
-
-remoting.MockSessionConnector.prototype.connectMe2App =
- function(host, fetchThirdPartyToken) {
- this.connect_();
-};
-
-remoting.MockSessionConnector.prototype.updatePairingInfo =
- function(clientId, sharedSecret) {
-};
-
-remoting.MockSessionConnector.prototype.connectIT2Me =
- function(accessCode) {
- this.connect_();
-};
-
-remoting.MockSessionConnector.prototype.reconnect = function() {
- this.connect_();
-};
-
-remoting.MockSessionConnector.prototype.cancel = function() {
-};
-
-remoting.MockSessionConnector.prototype.getHostId = function() {
- return this.hostId_;
-};
-
-remoting.MockSessionConnector.prototype.connect_ = function() {
- var signalling = new remoting.MockSignalStrategy();
- signalling.setStateForTesting(remoting.SignalStrategy.State.CONNECTED);
- var hostName = 'Mock host';
- var accessCode = '';
- var authenticationMethods = '';
- var hostId = '';
- var hostJid = '';
- var hostPublicKey = '';
- var clientPairingId = '';
- var clientPairedSecret = '';
-
- /**
- * @param {boolean} offerPairing
- * @param {function(string):void} callback
- */
- var fetchPin = function(offerPairing, callback) {
- window.setTimeout(function() { callback('') }, 0);
- };
-
- /**
- * @param {string} tokenUrl
- * @param {string} hostPublicKey
- * @param {string} scope
- * @param {function(string, string):void} callback
- */
- var fetchThirdPartyToken = function(tokenUrl, hostPublicKey, scope,
- callback) {
- window.setTimeout(function() { callback('', '') }, 0);
- };
-
- var clientSession = new remoting.ClientSession(
- signalling, this.clientContainer_, hostName,
- accessCode, fetchPin, fetchThirdPartyToken,
- authenticationMethods, hostId, hostJid, hostPublicKey,
- clientPairingId, clientPairedSecret);
-
- var that = this;
- /** @param {remoting.ClientSession.StateEvent} event */
- var onStateChange = function(event) {
- if (event.current == remoting.ClientSession.State.CONNECTED) {
- that.onConnected_(clientSession);
- }
- };
-
- clientSession.addEventListener(
- remoting.ClientSession.Events.stateChanged,
- onStateChange);
-};
-
-
-/**
- * @constructor
- * @extends {remoting.SessionConnectorFactory}
- */
-remoting.MockSessionConnectorFactory = function() {};
-
-/**
- * @param {HTMLElement} clientContainer Container element for the client view.
- * @param {function(remoting.ClientSession):void} onConnected Callback on
- * success.
- * @param {function(!remoting.Error):void} onError Callback on error.
- * @param {function(string, string):boolean} onExtensionMessage The handler for
- * protocol extension messages. Returns true if a message is recognized;
- * false otherwise.
- * @param {function(!remoting.Error):void} onConnectionFailed Callback for when
- * the connection fails.
- * @param {Array<string>} requiredCapabilities Connector capabilities
- * required by this application.
- * @param {string} defaultRemapKeys The default set of key mappings to use
- * in the client session.
- * @return {remoting.MockSessionConnector}
- */
-remoting.MockSessionConnectorFactory.prototype.createConnector =
- function(clientContainer, onConnected, onError, onExtensionMessage,
- onConnectionFailed, requiredCapabilities, defaultRemapKeys) {
- return new remoting.MockSessionConnector(
- clientContainer, onConnected, onError, onExtensionMessage,
- onConnectionFailed, requiredCapabilities, defaultRemapKeys);
-};
diff --git a/remoting/webapp/crd/js/session_connector.js b/remoting/webapp/crd/js/session_connector.js
deleted file mode 100644
index 4481f5c..0000000
--- a/remoting/webapp/crd/js/session_connector.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * Interface abstracting the SessionConnector functionality.
- */
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-/**
- * @interface
- */
-remoting.SessionConnector = function() {};
-
-/**
- * Initiates a remote connection.
- *
- * @param {remoting.Application.Mode} mode
- * @param {remoting.Host} host
- * @param {remoting.CredentialsProvider} credentialsProvider
- * @param {boolean=} opt_suppressOfflineError Suppress the host offline error
- * as we use stale JID's when initiating a Me2Me. This parameter will be
- * removed when we get rid of sessionConnector altogether in a future CL.
- * @return {void} Nothing.
- */
-remoting.SessionConnector.prototype.connect =
- function(mode, host, credentialsProvider, opt_suppressOfflineError) {};
-
-/**
- * @interface
- */
-remoting.SessionConnectorFactory = function() {};
-
-/**
- * @param {HTMLElement} clientContainer Container element for the client view.
- * @param {Array<string>} requiredCapabilities Connector capabilities
- * required by this application.
- * @param {remoting.ClientSession.EventHandler} handler
- * @return {remoting.SessionConnector}
- */
-remoting.SessionConnectorFactory.prototype.createConnector =
- function(clientContainer, requiredCapabilities, handler) {};
-
-/**
- * @type {remoting.SessionConnectorFactory}
- */
-remoting.SessionConnector.factory = null;
diff --git a/remoting/webapp/crd/js/session_connector_impl.js b/remoting/webapp/crd/js/session_connector_impl.js
deleted file mode 100644
index 438a1f0..0000000
--- a/remoting/webapp/crd/js/session_connector_impl.js
+++ /dev/null
@@ -1,291 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview
- * Connect set-up state machine for Me2Me and IT2Me
- */
-
-'use strict';
-
-/** @suppress {duplicate} */
-var remoting = remoting || {};
-
-/**
- * @param {HTMLElement} clientContainer Container element for the client view.
- * @param {Array<string>} requiredCapabilities Connector capabilities
- * required by this application.
- * @param {remoting.ClientSession.EventHandler} handler
- * @constructor
- * @implements {remoting.SessionConnector}
- */
-remoting.SessionConnectorImpl =
- function(clientContainer, requiredCapabilities, handler) {
- /** @private {HTMLElement} */
- this.clientContainer_ = clientContainer;
-
- /** @private */
- this.onError_ = handler.onError.bind(handler);
-
- /** @private */
- this.handler_ = handler;
-
- /** @private {Array<string>} */
- this.requiredCapabilities_ = [
- remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION,
- remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS,
- remoting.ClientSession.Capability.VIDEO_RECORDER
- ];
-
- // Append the app-specific capabilities.
- this.requiredCapabilities_.push.apply(this.requiredCapabilities_,
- requiredCapabilities);
-
- // Initialize/declare per-connection state.
- this.closeSession_();
-};
-
-/**
- * Reset the per-connection state so that the object can be re-used for a
- * second connection. Note the none of the shared WCS state is reset.
- * @private
- */
-remoting.SessionConnectorImpl.prototype.closeSession_ = function() {
- // It's OK to initialize these member variables here because the
- // constructor calls this method.
-
- base.dispose(this.eventHook_);
- /** @private {base.Disposable} */
- this.eventHook_ = null;
-
- /** @private {remoting.Host} */
- this.host_ = null;
-
- /** @private {boolean} */
- this.logHostOfflineErrors_ = false;
-
- base.dispose(this.clientSession_);
- /** @private {remoting.ClientSession} */
- this.clientSession_ = null;
-
- base.dispose(this.plugin_);
- /** @private {remoting.ClientPlugin} */
- this.plugin_ = null;
-
- /** @private {remoting.CredentialsProvider} */
- this.credentialsProvider_ = null;
-
- base.dispose(this.signalStrategy_);
- /** @private {remoting.SignalStrategy} */
- this.signalStrategy_ = null;
-};
-
-/**
- * Initiates a connection.
- *
- * @param {remoting.Application.Mode} mode
- * @param {remoting.Host} host the Host to connect to.
- * @param {remoting.CredentialsProvider} credentialsProvider
- * @param {boolean=} opt_suppressOfflineError
- * @return {void} Nothing.
- * @private
- */
-remoting.SessionConnectorImpl.prototype.connect =
- function(mode, host, credentialsProvider, opt_suppressOfflineError) {
- // In some circumstances, the WCS <iframe> can get reloaded, which results
- // in a new clientJid and a new callback. In this case, cancel any existing
- // connect operation and remove the old client plugin before instantiating a
- // new one.
- this.closeSession_();
- remoting.app.setConnectionMode(mode);
- this.host_ = host;
- this.credentialsProvider_ = credentialsProvider;
- this.logHostOfflineErrors_ = !Boolean(opt_suppressOfflineError);
- this.connectSignaling_();
-};
-
-/**
- * @private
- */
-remoting.SessionConnectorImpl.prototype.connectSignaling_ = function() {
- base.dispose(this.signalStrategy_);
- this.signalStrategy_ = null;
-
- /** @type {remoting.SessionConnectorImpl} */
- var that = this;
-
- /** @param {string} token */
- function connectSignalingWithToken(token) {
- remoting.identity.getUserInfo().then(
- connectSignalingWithTokenAndUserInfo.bind(null, token),
- remoting.Error.handler(that.onError_));
- }
-
- /**
- * Success callback for when the email and fullName have been retrieved
- * for this user.
- * Note that the full name will be null unless the webapp has requested
- * and been granted the userinfo.profile permission.
- *
- * @param {string} token
- * @param {{email: string, name: string}} userInfo
- */
- function connectSignalingWithTokenAndUserInfo(token, userInfo) {
- that.signalStrategy_.connect(remoting.settings.XMPP_SERVER, userInfo.email,
- token);
- }
-
- this.signalStrategy_ = remoting.SignalStrategy.create();
- this.signalStrategy_.setStateChangedCallback(
- this.onSignalingState_.bind(this));
-
- remoting.identity.getToken().then(
- connectSignalingWithToken,
- remoting.Error.handler(this.onError_));
-};
-
-/**
- * @private
- * @param {remoting.SignalStrategy.State} state
- */
-remoting.SessionConnectorImpl.prototype.onSignalingState_ = function(state) {
- switch (state) {
- case remoting.SignalStrategy.State.CONNECTED:
- // Proceed only if the connection hasn't been canceled.
- if (this.host_.jabberId) {
- this.createSession_();
- }
- break;
-
- case remoting.SignalStrategy.State.FAILED:
- this.onError_(this.signalStrategy_.getError());
- break;
- }
-};
-
-/**
- * Creates ClientSession object.
- */
-remoting.SessionConnectorImpl.prototype.createSession_ = function() {
- var pluginContainer = this.clientContainer_.querySelector(
- '.client-plugin-container');
-
- this.plugin_ = remoting.ClientPlugin.factory.createPlugin(
- pluginContainer, this.requiredCapabilities_);
-
- var that = this;
- this.host_.options.load().then(function(){
- that.plugin_.initialize(that.onPluginInitialized_.bind(that));
- });
-};
-
-/**
- * @param {boolean} initialized
- * @private
- */
-remoting.SessionConnectorImpl.prototype.onPluginInitialized_ = function(
- initialized) {
- if (!initialized) {
- console.error('ERROR: remoting plugin not loaded');
- this.pluginError_(new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
- return;
- }
-
- if (!this.plugin_.isSupportedVersion()) {
- console.error('ERROR: bad plugin version');
- this.pluginError_(new remoting.Error(
- remoting.Error.Tag.BAD_PLUGIN_VERSION));
- return;
- }
-
- this.clientSession_ = new remoting.ClientSession(
- this.plugin_, this.host_, this.signalStrategy_);
-
- this.clientSession_.logHostOfflineErrors(this.logHostOfflineErrors_);
- this.eventHook_ = new base.EventHook(
- this.clientSession_, 'stateChanged', this.onStateChange_.bind(this));
- this.plugin_.connect(
- this.host_, this.signalStrategy_.getJid(), this.credentialsProvider_);
-};
-
-/**
- * @param {!remoting.Error} error
- * @private
- */
-remoting.SessionConnectorImpl.prototype.pluginError_ = function(error) {
- this.signalStrategy_.setIncomingStanzaCallback(null);
- this.closeSession_();
-};
-
-/**
- * Handle a change in the state of the client session.
- *
- * @param {remoting.ClientSession.StateEvent=} event
- * @return {void} Nothing.
- * @private
- */
-remoting.SessionConnectorImpl.prototype.onStateChange_ = function(event) {
- switch (event.current) {
- case remoting.ClientSession.State.CONNECTED:
- var connectionInfo = new remoting.ConnectionInfo(
- this.host_, this.credentialsProvider_, this.clientSession_,
- this.plugin_);
- this.handler_.onConnected(connectionInfo);
- break;
-
- case remoting.ClientSession.State.CONNECTING:
- remoting.identity.getEmail().then(function(/** string */ email) {
- console.log('Connecting as ' + email);
- });
- break;
-
- case remoting.ClientSession.State.AUTHENTICATED:
- console.log('Connection authenticated');
- break;
-
- case remoting.ClientSession.State.INITIALIZING:
- console.log('Initializing connection');
- break;
-
- case remoting.ClientSession.State.CLOSED:
- this.handler_.onDisconnected();
- break;
-
- case remoting.ClientSession.State.FAILED:
- var error = this.clientSession_.getError();
- console.error('Client plugin reported connection failed: ' +
- error.toString());
- this.handler_.onConnectionFailed(error || remoting.Error.unexpected());
- break;
-
- default:
- console.error('Unexpected client plugin state: ' + event.current);
- // This should only happen if the web-app and client plugin get out of
- // sync, and even then the version check should ensure compatibility.
- this.onError_(new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
- }
-
- if (this.clientSession_.isFinished()) {
- this.closeSession_();
- }
-};
-
-/**
- * @constructor
- * @implements {remoting.SessionConnectorFactory}
- */
-remoting.DefaultSessionConnectorFactory = function() {};
-
-/**
- * @param {HTMLElement} clientContainer Container element for the client view.
- * @param {Array<string>} requiredCapabilities Connector capabilities
- * required by this application.
- * @param {remoting.ClientSession.EventHandler} handler
- * @return {remoting.SessionConnector}
- */
-remoting.DefaultSessionConnectorFactory.prototype.createConnector =
- function(clientContainer, requiredCapabilities, handler) {
- return new remoting.SessionConnectorImpl(clientContainer,
- requiredCapabilities, handler);
-};
diff --git a/remoting/webapp/files.gni b/remoting/webapp/files.gni
index 21ec428..8cb49e7 100644
--- a/remoting/webapp/files.gni
+++ b/remoting/webapp/files.gni
@@ -155,17 +155,16 @@ remoting_webapp_js_cast_extension_files = [ "crd/js/cast_extension_handler.js" ]
# Client JavaScript files.
remoting_webapp_js_client_files = [
"crd/js/client_plugin.js",
- "crd/js/client_plugin_impl.js",
"crd/js/client_plugin_host_desktop_impl.js",
+ "crd/js/client_plugin_impl.js",
"crd/js/client_session.js",
+ "crd/js/client_session_factory.js",
"crd/js/clipboard.js",
"crd/js/connected_view.js",
"crd/js/connection_info.js",
"crd/js/credentials_provider.js",
"crd/js/desktop_connected_view.js",
"crd/js/host_desktop.js",
- "crd/js/session_connector.js",
- "crd/js/session_connector_impl.js",
"crd/js/smart_reconnector.js",
"crd/js/video_frame_recorder.js",
]