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

Unified Diff: remoting/webapp/app_remoting/js/app_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/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/application.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/app_remoting/js/app_remoting_activity.js
diff --git a/remoting/webapp/app_remoting/js/app_remoting_activity.js b/remoting/webapp/app_remoting/js/app_remoting_activity.js
index 3685946ef08a53ce7e2dbca4c2477df1278ae859..fecd55d55bf37f7d98addd5fabc9d3f0172e745a 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));
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/application.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698