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

Unified Diff: remoting/webapp/me2mom/remoting.js

Issue 7511001: Don't transition to in-session mode until the connection has been established. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
Index: remoting/webapp/me2mom/remoting.js
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index 8433a90e62a830db87c6b514668365a67ce27297..76f6ef96d1046b58f8b138b748ef03a425d88235 100644
--- a/remoting/webapp/me2mom/remoting.js
+++ b/remoting/webapp/me2mom/remoting.js
@@ -458,9 +458,13 @@ function onClientStateChange_(state) {
host = split[0];
}
setClientStateMessage('Connected to', host);
+ setGlobalMode(remoting.AppMode.IN_SESSION);
updateStatistics();
} else if (state == remoting.ClientSession.State.CLOSED) {
setClientStateMessage('Closed');
+ if (remoting.session.state != remoting.ClientSession.State.CONNECTED) {
+ showConnectError_(404);
Jamie 2011/07/25 23:09:50 This is not quite correct, as it will report "Inva
awong 2011/07/26 18:51:27 Add TODO?
Jamie 2011/07/26 19:02:35 Done.
+ }
} else if (state == remoting.ClientSession.State.CONNECTION_FAILED) {
setClientStateMessage('Failed');
} else {
@@ -471,7 +475,6 @@ function onClientStateChange_(state) {
function startSession_() {
remoting.debug.log('Starting session...');
remoting.username = getEmail();
- setGlobalMode(remoting.AppMode.IN_SESSION);
remoting.session =
new remoting.ClientSession(remoting.hostJid, remoting.hostPublicKey,
remoting.accessCode, getEmail(),
« remoting/webapp/me2mom/client_session.js ('K') | « remoting/webapp/me2mom/client_session.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698