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

Side by Side Diff: ui/login/account_picker/screen_account_picker.js

Issue 2260653002: Pin keyboard works with virtual keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed patch set 1 errors. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview Account picker screen implementation. 6 * @fileoverview Account picker screen implementation.
7 */ 7 */
8 8
9 login.createScreen('AccountPickerScreen', 'account-picker', function() { 9 login.createScreen('AccountPickerScreen', 'account-picker', function() {
10 /** 10 /**
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 [activatedPod.user.emailAddress]); 173 [activatedPod.user.emailAddress]);
174 activatedPod.showSigninUI(); 174 activatedPod.showSigninUI();
175 } else { 175 } else {
176 if (loginAttempts == 1) { 176 if (loginAttempts == 1) {
177 chrome.send('firstIncorrectPasswordAttempt', 177 chrome.send('firstIncorrectPasswordAttempt',
178 [activatedPod.user.emailAddress]); 178 [activatedPod.user.emailAddress]);
179 } 179 }
180 // We want bubble's arrow to point to the first letter of input. 180 // We want bubble's arrow to point to the first letter of input.
181 /** @const */ var BUBBLE_OFFSET = 7; 181 /** @const */ var BUBBLE_OFFSET = 7;
182 /** @const */ var BUBBLE_PADDING = 4; 182 /** @const */ var BUBBLE_PADDING = 4;
183 $('bubble').showContentForElement(activatedPod.mainInput, 183
184 cr.ui.Bubble.Attachment.BOTTOM, 184 // We want the bubble to point to where the input is after it is done
185 error, 185 // tranisitioning.
186 BUBBLE_OFFSET, BUBBLE_PADDING); 186 var showBottomCallback = function() {
jdufault 2016/08/24 01:35:11 Does this work if we are not showing the PIN keybo
sammiequon 2016/08/25 18:12:33 Yes. The transition end event comes from the pod.
187 activatedPod.removeEventListener("transitionend", showBottomCallback);
188 $('bubble').showContentForElement(activatedPod.mainInput,
189 cr.ui.Bubble.Attachment.BOTTOM,
190 error,
191 BUBBLE_OFFSET, BUBBLE_PADDING);
192 };
193 activatedPod.addEventListener("transitionend",showBottomCallback,
jdufault 2016/08/24 01:35:10 Add ensureTransitionEndEvent guards
jdufault 2016/08/24 01:35:11 Add space after comma
sammiequon 2016/08/25 18:12:33 Done.
sammiequon 2016/08/25 18:12:33 Done.
194 false);
195
187 // Move error bubble up if it overlaps the shelf. 196 // Move error bubble up if it overlaps the shelf.
188 var maxHeight = 197 var maxHeight =
189 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble')); 198 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping($('bubble'));
190 if (maxHeight < $('bubble').offsetHeight) { 199 if (maxHeight < $('bubble').offsetHeight) {
191 $('bubble').showContentForElement(activatedPod.mainInput, 200 var showTopCallback = function() {
192 cr.ui.Bubble.Attachment.TOP, 201 activatedPod.removeEventListener("transitionend", showTopCallback);
193 error, 202 $('bubble').showContentForElement(activatedPod.mainInput,
194 BUBBLE_OFFSET, BUBBLE_PADDING); 203 cr.ui.Bubble.Attachment.TOP,
204 error,
205 BUBBLE_OFFSET, BUBBLE_PADDING);
206 };
207 activatedPod.addEventListener("transitionend", showTopCallback,
208 false);
195 } 209 }
196 } 210 }
197 }, 211 },
198 212
199 /** 213 /**
200 * Loads the PIN keyboard if any of the users can login with a PIN. 214 * Loads the PIN keyboard if any of the users can login with a PIN.
201 * @param {array} users Array of user instances. 215 * @param {array} users Array of user instances.
202 */ 216 */
203 loadPinKeyboardIfNeeded_: function(users) { 217 loadPinKeyboardIfNeeded_: function(users) {
204 for (var i = 0; i < users.length; ++i) { 218 for (var i = 0; i < users.length; ++i) {
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 * @param {string} userID The user ID of the public session 408 * @param {string} userID The user ID of the public session
395 * @param {string} locale The locale to which this list of keyboard layouts 409 * @param {string} locale The locale to which this list of keyboard layouts
396 * applies 410 * applies
397 * @param {!Object} list List of available keyboard layouts 411 * @param {!Object} list List of available keyboard layouts
398 */ 412 */
399 setPublicSessionKeyboardLayouts: function(userID, locale, list) { 413 setPublicSessionKeyboardLayouts: function(userID, locale, list) {
400 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); 414 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list);
401 } 415 }
402 }; 416 };
403 }); 417 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698