| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 }, | 64 }, |
| 65 | 65 |
| 66 /** @override */ | 66 /** @override */ |
| 67 getPreferredSize: function() { | 67 getPreferredSize: function() { |
| 68 return {width: this.preferredWidth_, height: this.preferredHeight_}; | 68 return {width: this.preferredWidth_, height: this.preferredHeight_}; |
| 69 }, | 69 }, |
| 70 | 70 |
| 71 /** @override */ | 71 /** @override */ |
| 72 onWindowResize: function() { | 72 onWindowResize: function() { |
| 73 $('pod-row').onWindowResize(); | 73 $('pod-row').onWindowResize(); |
| 74 | |
| 75 // Reposition the error bubble, if it is showing. Since we are just | |
| 76 // moving the bubble, the number of login attempts tried doesn't matter. | |
| 77 var errorBubble = $('bubble'); | |
| 78 if (errorBubble && !errorBubble.hidden) | |
| 79 this.showErrorBubble(0, undefined /* Reuses the existing message. */); | |
| 80 }, | 74 }, |
| 81 | 75 |
| 82 /** | 76 /** |
| 83 * Sets preferred size for account picker screen. | 77 * Sets preferred size for account picker screen. |
| 84 */ | 78 */ |
| 85 setPreferredSize: function(width, height) { | 79 setPreferredSize: function(width, height) { |
| 86 this.preferredWidth_ = width; | 80 this.preferredWidth_ = width; |
| 87 this.preferredHeight_ = height; | 81 this.preferredHeight_ = height; |
| 88 }, | 82 }, |
| 89 | 83 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 $('pod-row').removeUserPod(username); | 349 $('pod-row').removeUserPod(username); |
| 356 }, | 350 }, |
| 357 | 351 |
| 358 /** | 352 /** |
| 359 * Displays a banner containing |message|. If the banner is already present | 353 * Displays a banner containing |message|. If the banner is already present |
| 360 * this function updates the message in the banner. This function is used | 354 * this function updates the message in the banner. This function is used |
| 361 * by the chrome.screenlockPrivate.showMessage API. | 355 * by the chrome.screenlockPrivate.showMessage API. |
| 362 * @param {string} message Text to be displayed or empty to hide the banner. | 356 * @param {string} message Text to be displayed or empty to hide the banner. |
| 363 */ | 357 */ |
| 364 showBannerMessage: function(message) { | 358 showBannerMessage: function(message) { |
| 365 var banner = $('signin-banner'); | 359 $('pod-row').showBannerMessage(message); |
| 366 banner.textContent = message; | |
| 367 banner.classList.toggle('message-set', !!message); | |
| 368 }, | 360 }, |
| 369 | 361 |
| 370 /** | 362 /** |
| 371 * Shows a custom icon in the user pod of |username|. This function | 363 * Shows a custom icon in the user pod of |username|. This function |
| 372 * is used by the chrome.screenlockPrivate API. | 364 * is used by the chrome.screenlockPrivate API. |
| 373 * @param {string} username Username of pod to add button | 365 * @param {string} username Username of pod to add button |
| 374 * @param {!{id: !string, | 366 * @param {!{id: !string, |
| 375 * hardlockOnClick: boolean, | 367 * hardlockOnClick: boolean, |
| 376 * isTrialRun: boolean, | 368 * isTrialRun: boolean, |
| 377 * tooltip: ({text: string, autoshow: boolean} | undefined)}} icon | 369 * tooltip: ({text: string, autoshow: boolean} | undefined)}} icon |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 return; | 500 return; |
| 509 } | 501 } |
| 510 chrome.send('setLockScreenAppsState', | 502 chrome.send('setLockScreenAppsState', |
| 511 [LOCK_SCREEN_APPS_STATE.FOREGROUND]); | 503 [LOCK_SCREEN_APPS_STATE.FOREGROUND]); |
| 512 | 504 |
| 513 event.preventDefault(); | 505 event.preventDefault(); |
| 514 event.stopPropagation(); | 506 event.stopPropagation(); |
| 515 }, | 507 }, |
| 516 }; | 508 }; |
| 517 }); | 509 }); |
| OLD | NEW |