Chromium Code Reviews| Index: remoting/webapp/me2mom/remoting.js |
| =================================================================== |
| --- remoting/webapp/me2mom/remoting.js (revision 88003) |
| +++ remoting/webapp/me2mom/remoting.js (working copy) |
| @@ -157,20 +157,25 @@ |
| function setHostMode(mode) { |
| var section = document.getElementById('host-section'); |
| var modes = section.getElementsByClassName('mode'); |
| + addToDebugLog('Host mode: ' + mode); |
| setMode_(mode, modes); |
| } |
| function setClientMode(mode) { |
| var section = document.getElementById('client-section'); |
| var modes = section.getElementsByClassName('mode'); |
| + addToDebugLog('Client mode: ' + mode); |
| setMode_(mode, modes); |
| } |
| function tryShare() { |
| + addToDebugLog("Attempting to share..."); |
| if (remoting.oauth2.needsNewAccessToken()) { |
| + addToDebugLog("Refreshing token..."); |
| remoting.oauth2.refreshAccessToken(function() { |
| if (remoting.oauth2.needsNewAccessToken()) { |
| // If we still need it, we're going to infinite loop. |
| + addToDebugLog("Unable to get access token"); |
| throw "Unable to get access token"; |
| } |
| tryShare(); |
| @@ -205,16 +210,19 @@ |
| setHostMode('unshared'); |
| plugin.parentNode.removeChild(plugin); |
| } else { |
| + addToDebugLog('Unknown state -> ' + state); |
| window.alert('Unknown state -> ' + state); |
|
Jamie
2011/06/07 18:58:32
It seems redundant to do both of these.
garykac
2011/06/07 20:44:32
Done.
|
| } |
| } |
| function cancelShare() { |
| + addToDebugLog('Canceling share'); |
|
Jamie
2011/06/07 18:58:32
pico-nit: Add an elipsis to this (and the next) lo
garykac
2011/06/07 20:44:32
Done.
|
| var plugin = document.getElementById(remoting.HOST_PLUGIN_ID); |
| plugin.disconnect(); |
| } |
| function startSession_() { |
| + addToDebugLog('Starting session'); |
| remoting.username = remoting.getItem(remoting.XMPP_LOGIN_NAME); |
| document.location = 'remoting_session.html'; |
| } |