| OLD | NEW |
| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping(bubbleAnchor) | 218 cr.ui.LoginUITools.getMaxHeightBeforeShelfOverlapping(bubbleAnchor) |
| 219 - bubbleAnchor.offsetHeight - BUBBLE_POD_OFFSET; | 219 - bubbleAnchor.offsetHeight - BUBBLE_POD_OFFSET; |
| 220 var maxWidth = cr.ui.LoginUITools.getMaxWidthToFit(bubbleAnchor) | 220 var maxWidth = cr.ui.LoginUITools.getMaxWidthToFit(bubbleAnchor) |
| 221 - bubbleAnchor.offsetWidth - BUBBLE_POD_OFFSET; | 221 - bubbleAnchor.offsetWidth - BUBBLE_POD_OFFSET; |
| 222 | 222 |
| 223 // Change bubble visibility temporary to calculate height. | 223 // Change bubble visibility temporary to calculate height. |
| 224 var bubbleVisibility = bubble.style.visibility; | 224 var bubbleVisibility = bubble.style.visibility; |
| 225 bubble.style.visibility = 'hidden'; | 225 bubble.style.visibility = 'hidden'; |
| 226 bubble.hidden = false; | 226 bubble.hidden = false; |
| 227 // Now we need the bubble to have the new content before calculating | 227 // Now we need the bubble to have the new content before calculating |
| 228 // size. | 228 // size. Undefined |error| == reuse old content. |
| 229 bubble.replaceContent(error); | 229 if (error !== undefined) |
| 230 bubble.replaceContent(error); |
| 231 |
| 230 // Get bubble size. | 232 // Get bubble size. |
| 231 var bubbleOffsetHeight = parseInt(bubble.offsetHeight); | 233 var bubbleOffsetHeight = parseInt(bubble.offsetHeight); |
| 232 var bubbleOffsetWidth = parseInt(bubble.offsetWidth); | 234 var bubbleOffsetWidth = parseInt(bubble.offsetWidth); |
| 233 // Restore attributes. | 235 // Restore attributes. |
| 234 bubble.style.visibility = bubbleVisibility; | 236 bubble.style.visibility = bubbleVisibility; |
| 235 bubble.hidden = true; | 237 bubble.hidden = true; |
| 236 | 238 |
| 237 if (attachment == cr.ui.Bubble.Attachment.BOTTOM) { | 239 if (attachment == cr.ui.Bubble.Attachment.BOTTOM) { |
| 238 // Move error bubble if it overlaps the shelf. | 240 // Move error bubble if it overlaps the shelf. |
| 239 if (maxHeight < bubbleOffsetHeight) | 241 if (maxHeight < bubbleOffsetHeight) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 * @param {string} userID The user ID of the public session | 467 * @param {string} userID The user ID of the public session |
| 466 * @param {string} locale The locale to which this list of keyboard layouts | 468 * @param {string} locale The locale to which this list of keyboard layouts |
| 467 * applies | 469 * applies |
| 468 * @param {!Object} list List of available keyboard layouts | 470 * @param {!Object} list List of available keyboard layouts |
| 469 */ | 471 */ |
| 470 setPublicSessionKeyboardLayouts: function(userID, locale, list) { | 472 setPublicSessionKeyboardLayouts: function(userID, locale, list) { |
| 471 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); | 473 $('pod-row').setPublicSessionKeyboardLayouts(userID, locale, list); |
| 472 } | 474 } |
| 473 }; | 475 }; |
| 474 }); | 476 }); |
| OLD | NEW |