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

Unified Diff: chrome/browser/resources/chromeos/login/oobe.js

Issue 7607019: [ChromeOS] Reset Gaia UI and show error if needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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: chrome/browser/resources/chromeos/login/oobe.js
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js
index 0f3ad64ff3fe8967e7498d224a0f855d86db3234..72ede4e9e213754007d4279973df5d62f764cda5 100644
--- a/chrome/browser/resources/chromeos/login/oobe.js
+++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -455,8 +455,12 @@ cr.define('cr.ui', function() {
*/
Oobe.resetSigninUI = function() {
var currentScreenId = Oobe.getInstance().currentScreen.id;
+
if (localStrings.getString('authType') == 'webui')
- $('signin').reset(currentScreenId == SCREEN_SIGNIN);
+ $(SCREEN_SIGNIN).reset(currentScreenId == SCREEN_SIGNIN);
+ else
+ $(SCREEN_GAIA_SIGNIN).reset(currentScreenId == SCREEN_GAIA_SIGNIN);
+
$('pod-row').reset(currentScreenId == SCREEN_ACCOUNT_PICKER);
};
@@ -470,11 +474,19 @@ cr.define('cr.ui', function() {
Oobe.showSignInError = function(loginAttempts, message, link, helpId) {
var currentScreenId = Oobe.getInstance().currentScreen.id;
var anchor = undefined;
+ var anchorPos = undefined;
if (currentScreenId == SCREEN_SIGNIN) {
anchor = $('email');
// Show email field so that bubble shows up at the right location.
- $('signin').reset(true);
+ $(SCREEN_SIGNIN).reset(true);
+ } else if (currentScreenId == SCREEN_GAIA_SIGNIN) {
+ // Use anchorPos since we won't be able to get the input fields of Gaia.
+ anchorPos = Oobe.getOffset(Oobe.getInstance().currentScreen);
+
+ // TODO(xiyuan): Find a reliable way to align with Gaia UI.
+ anchorPos.left += 60;
+ anchorPos.top += 105;
} else if (currentScreenId == SCREEN_ACCOUNT_PICKER &&
$('pod-row').activated) {
const MAX_LOGIN_ATTEMMPTS_IN_POD = 3;
@@ -485,8 +497,8 @@ cr.define('cr.ui', function() {
anchor = $('pod-row').activated.mainInput;
}
- if (!anchor) {
- console.log('Warning: Failed to find anchor element for error :' +
+ if (!anchor && !anchorPos) {
+ console.log('Warning: Failed to find anchor for error :' +
message);
return;
}
@@ -510,7 +522,17 @@ cr.define('cr.ui', function() {
error.appendChild(helpLink);
}
- $('bubble').showContentForElement(anchor, error);
+ if (anchor)
+ $('bubble').showContentForElement(anchor, error);
+ else if (anchorPos)
+ $('bubble').showContentAt(anchorPos.left, anchorPos.top, error);
+ };
+
+ /**
+ * Clears error bubble.
+ */
+ Oobe.clearErrors = function() {
+ $('bubble').hide();
};
/**
« no previous file with comments | « chrome/browser/resources/chromeos/login/bubble.js ('k') | chrome/browser/resources/chromeos/login/screen_gaia_signin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698