diff options
author | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-13 22:43:00 +0000 |
---|---|---|
committer | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-13 22:43:00 +0000 |
commit | f8016b7c53b440b7c7f4b9a6cbc36d35a11f38bc (patch) | |
tree | 26842b7df3eb4c71dec6065d4f3d65131b1aae31 /remoting/webapp/client_screen.js | |
parent | 69d7ff44b9e354ffd8a65f6ab911c0870b012535 (diff) | |
download | chromium_src-f8016b7c53b440b7c7f4b9a6cbc36d35a11f38bc.zip chromium_src-f8016b7c53b440b7c7f4b9a6cbc36d35a11f38bc.tar.gz chromium_src-f8016b7c53b440b7c7f4b9a6cbc36d35a11f38bc.tar.bz2 |
Don't re-prompt for PIN on reconnect.
BUG=113694, 113506
TEST=Manual
Review URL: http://codereview.chromium.org/9378029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/client_screen.js')
-rw-r--r-- | remoting/webapp/client_screen.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/remoting/webapp/client_screen.js b/remoting/webapp/client_screen.js index 45edbcb..3e6ae7c 100644 --- a/remoting/webapp/client_screen.js +++ b/remoting/webapp/client_screen.js @@ -188,6 +188,11 @@ function onClientStateChange_(oldState, newState) { // to the session object and should ignore any state changes. return; } + + // Clear the PIN on successful connection, or on error if we're not going to + // automatically retry. + var clearPin = false; + if (newState == remoting.ClientSession.State.CREATED) { remoting.debug.log('Created plugin'); @@ -202,6 +207,7 @@ function onClientStateChange_(oldState, newState) { } else if (newState == remoting.ClientSession.State.CONNECTED) { if (remoting.clientSession) { + clearPin = true; remoting.setMode(remoting.AppMode.IN_SESSION); remoting.toolbar.center(); remoting.toolbar.preview(); @@ -228,8 +234,10 @@ function onClientStateChange_(oldState, newState) { } else if (newState == remoting.ClientSession.State.CONNECTION_FAILED) { remoting.debug.log('Client plugin reported connection failed: ' + remoting.clientSession.error); + clearPin = true; if (remoting.clientSession.error == remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE) { + clearPin = false; retryConnectOrReportOffline_(); } else if (remoting.clientSession.error == remoting.ClientSession.ConnectionError.SESSION_REJECTED) { @@ -244,6 +252,10 @@ function onClientStateChange_(oldState, newState) { showConnectError_(remoting.Error.GENERIC); } + if (clearPin) { + document.getElementById('pin-entry').value = ''; + } + } else { remoting.debug.log('Unexpected client plugin state: ' + newState); // This should only happen if the web-app and client plugin get out of @@ -264,7 +276,8 @@ function retryConnectOrReportOffline_() { /** @param {boolean} success True if the refresh was successful. */ var onDone = function(success) { if (success) { - remoting.connectMe2Me(remoting.hostId, false); + remoting.retryIfOffline = false; + remoting.connectMe2MeWithPin(); } else { showConnectError_(remoting.Error.HOST_IS_OFFLINE); } @@ -475,7 +488,6 @@ function connectMe2MeWithAccessToken_(token) { if (token) { /** @type {string} */ var pin = document.getElementById('pin-entry').value; - document.getElementById('pin-entry').value = ''; remoting.clientSession = new remoting.ClientSession( |