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

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

Issue 9310050: [cros] Error bubble on login is displayed to the left of Gaia frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace. Created 8 years, 11 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/screen_account_picker.js
diff --git a/chrome/browser/resources/chromeos/login/screen_account_picker.js b/chrome/browser/resources/chromeos/login/screen_account_picker.js
index ec86e91c3f1901eae0af9ee3991363299e06f479..31a64b583423e7c02286e7515bc81127becd4195 100644
--- a/chrome/browser/resources/chromeos/login/screen_account_picker.js
+++ b/chrome/browser/resources/chromeos/login/screen_account_picker.js
@@ -8,6 +8,11 @@
cr.define('login', function() {
/**
+ * Maximum number of offline login failures before online login.
+ */
+ const MAX_LOGIN_ATTEMPTS_IN_POD = 3;
+
+ /**
* Creates a new account picker screen div.
* @constructor
* @extends {HTMLDivElement}
@@ -64,7 +69,7 @@ cr.define('login', function() {
if (lockedPod) {
var focusPod = function() {
podRow.focusPod(lockedPod);
- }
+ };
// TODO(altimofeev): empirically I investigated that focus isn't
// set correctly if following CSS rules are present:
//
@@ -97,6 +102,23 @@ cr.define('login', function() {
*/
onBeforeHide: function(data) {
$('pod-row').handleHide();
+ },
+
+ /**
+ * Shows sign-in error bubble.
+ * @param {number} loginAttempts Number of login attemps tried.
+ * @param {HTMLElement} content Content to show in bubble.
+ */
+ showErrorBubble: function(loginAttempts, error) {
+ var activatedPod = $('pod-row').activatedPod;
+ if (!activatedPod)
+ return;
+ if (loginAttempts > MAX_LOGIN_ATTEMPTS_IN_POD) {
+ activatedPod.showSigninUI();
+ } else {
+ $('bubble').showContentForElement(activatedPod.mainInput, error,
+ cr.ui.Bubble.Attachment.BOTTOM);
+ }
}
};

Powered by Google App Engine
This is Rietveld 408576698