Chromium Code Reviews| Index: remoting/webapp/remoting.js |
| diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js |
| index feda0ffec8e1efd2fd5516024a4d387fcbb23128..a8ab35bb6939e1809580b785469474ea963aba47 100644 |
| --- a/remoting/webapp/remoting.js |
| +++ b/remoting/webapp/remoting.js |
| @@ -39,6 +39,11 @@ remoting.init = function() { |
| l10n.localize(); |
| // Create global objects. |
| remoting.oauth2 = new remoting.OAuth2(); |
| + // TODO(jamiewalch): Reinstate this when we migrate to apps v2. |
| + // remoting.identity = new remoting.Identity( |
| + // document.getElementById('auth-dialog'), |
| + // document.getElementById('auth-button')); |
| + remoting.identity = remoting.oauth2; |
| remoting.stats = new remoting.ConnectionStats( |
| document.getElementById('statistics')); |
| remoting.formatIq = new remoting.FormatIq(); |
| @@ -58,7 +63,7 @@ remoting.init = function() { |
| } |
| ); |
| - remoting.oauth2.getEmail(remoting.onEmail, remoting.showErrorMessage); |
| + remoting.identity.getEmail(remoting.onEmail, remoting.showErrorMessage); |
| remoting.showOrHideIt2MeUi(); |
| remoting.showOrHideMe2MeUi(); |
| @@ -113,7 +118,10 @@ remoting.initDaemonUi = function () { |
| remoting.hostController = new remoting.HostController(); |
| document.getElementById('share-button').disabled = |
| !remoting.hostController.isPluginSupported(); |
| - remoting.setMode(getAppStartupMode_()); |
| + remoting.setMode(remoting.AppMode.HOME); |
| + if (!remoting.oauth2.isAuthenticated()) { |
|
Wez
2013/01/05 00:04:24
Is there an equivalent to isAuthenticated() for th
Jamie
2013/01/05 01:32:54
I don't think so.
rmsousa
2013/01/05 05:21:11
I'm not sure we need to do this here at all. For a
Jamie
2013/01/07 23:52:20
The problem with that approach is that the apps v2
Wez
2013/01/07 23:52:44
The one distinction between the identity and OAuth
|
| + document.getElementById('auth-dialog').hidden = false; |
| + } |
| remoting.hostSetupDialog = |
| new remoting.HostSetupDialog(remoting.hostController); |
| // Display the cached host list, then asynchronously update and re-display it. |
| @@ -190,7 +198,8 @@ remoting.promptClose = function() { |
| remoting.signOut = function() { |
| remoting.oauth2.clear(); |
| chrome.storage.local.clear(); |
| - remoting.setMode(remoting.AppMode.UNAUTHENTICATED); |
| + remoting.setMode(remoting.AppMode.HOME); |
| + document.getElementById('auth-dialog').hidden = false; |
| }; |
| /** |
| @@ -232,18 +241,6 @@ function pluginGotCopy_(eventUncast) { |
| } |
| /** |
| - * Gets the major-mode that this application should start up in. |
| - * |
| - * @return {remoting.AppMode} The mode to start in. |
| - */ |
| -function getAppStartupMode_() { |
| - if (!remoting.oauth2.isAuthenticated()) { |
| - return remoting.AppMode.UNAUTHENTICATED; |
| - } |
| - return remoting.AppMode.HOME; |
| -} |
| - |
| -/** |
| * Returns whether Host mode is supported on this platform. |
| * |
| * @return {boolean} True if Host mode is supported. |