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

Unified Diff: remoting/webapp/crd/js/desktop_remoting_activity.js

Issue 1097133002: [Webapp Refactor] Remove remoting.SessionConnector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge conflicts Created 5 years, 8 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/crd/js/client_session_factory_unittest.js ('k') | remoting/webapp/crd/js/it2me_activity.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/desktop_remoting_activity.js
diff --git a/remoting/webapp/crd/js/desktop_remoting_activity.js b/remoting/webapp/crd/js/desktop_remoting_activity.js
index 369b2281ee925c8a63fdec60c6708f62ac931346..1e64621ea129d48a1df16b40c2a092eedb5ae492 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;
};
« no previous file with comments | « remoting/webapp/crd/js/client_session_factory_unittest.js ('k') | remoting/webapp/crd/js/it2me_activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698