Index: remoting/webapp/crd/js/client_screen.js |
diff --git a/remoting/webapp/crd/js/client_screen.js b/remoting/webapp/crd/js/client_screen.js |
index 3b06083e9fd00a874c633a1a7eee5b9b8fcc3687..1c6fae9f9d94bdf5610dd7a9f120ea1ee5777769 100644 |
--- a/remoting/webapp/crd/js/client_screen.js |
+++ b/remoting/webapp/crd/js/client_screen.js |
@@ -73,6 +73,7 @@ remoting.disconnect = function() { |
} |
remoting.clientSession.disconnect(remoting.Error.NONE); |
remoting.clientSession = null; |
+ remoting.app.onDisconnected(); |
console.log('Disconnected.'); |
}; |
@@ -95,6 +96,7 @@ function onClientStateChange_(state) { |
} else { |
remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); |
} |
+ remoting.app.onDisconnected(); |
Jamie
2014/12/04 22:56:57
It shouldn't be necessary to call this twice. I th
garykac
2014/12/05 19:55:40
Done.
|
break; |
case remoting.ClientSession.State.FAILED: |
@@ -129,34 +131,8 @@ function onClientStateChange_(state) { |
*/ |
function showConnectError_(errorTag) { |
console.error('Connection failed: ' + errorTag); |
- var errorDiv = document.getElementById('connect-error-message'); |
- l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag)); |
+ remoting.app.onError(errorTag); |
Jamie
2014/12/04 22:56:57
It might take a bit more untangling, but I would p
garykac
2014/12/05 19:55:40
I originally had that change in a follow-up cl, bu
|
remoting.accessCode = ''; |
- var mode = remoting.clientSession ? remoting.clientSession.getMode() |
- : remoting.connector.getConnectionMode(); |
- if (mode == remoting.ClientSession.Mode.IT2ME) { |
- remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); |
- remoting.hangoutSessionEvents.raiseEvent( |
- remoting.hangoutSessionEvents.sessionStateChanged, |
- remoting.ClientSession.State.FAILED |
- ); |
- } else { |
- remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |
- } |
-} |
- |
-/** |
- * Set the text on the buttons shown under the error message so that they are |
- * easy to understand in the case where a successful connection failed, as |
- * opposed to the case where a connection never succeeded. |
- */ |
-function setConnectionInterruptedButtonsText_() { |
- var button1 = document.getElementById('client-reconnect-button'); |
- l10n.localizeElementFromTag(button1, /*i18n-content*/'RECONNECT'); |
- button1.removeAttribute('autofocus'); |
- var button2 = document.getElementById('client-finished-me2me-button'); |
- l10n.localizeElementFromTag(button2, /*i18n-content*/'OK'); |
- button2.setAttribute('autofocus', 'autofocus'); |
} |
/** |
@@ -318,19 +294,16 @@ remoting.connectMe2MeHostVersionAcknowledged_ = function(host) { |
remoting.onConnected = function(clientSession) { |
remoting.clientSession = clientSession; |
remoting.clientSession.addEventListener('stateChanged', onClientStateChange_); |
- setConnectionInterruptedButtonsText_(); |
- document.getElementById('access-code-entry').value = ''; |
- remoting.setMode(remoting.AppMode.IN_SESSION); |
- if (!base.isAppsV2()) { |
- remoting.toolbar.center(); |
- remoting.toolbar.preview(); |
- } |
+ |
+ remoting.app.onConnected(); |
Jamie
2014/12/04 22:56:57
What's the rationale for moving some, but not all
garykac
2014/12/05 19:55:40
I'm separating out the shared code from the CRD-sp
|
+ |
remoting.clipboard.startSession(); |
updateStatistics_(); |
remoting.hangoutSessionEvents.raiseEvent( |
remoting.hangoutSessionEvents.sessionStateChanged, |
remoting.ClientSession.State.CONNECTED |
); |
+ |
if (remoting.pairingRequested) { |
/** |
* @param {string} clientId |