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

Unified Diff: remoting/webapp/remoting.js

Issue 11769002: Apps v2 identity integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed identity.js from html. Fixed patch. Created 7 years, 12 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/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.

Powered by Google App Engine
This is Rietveld 408576698