OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 User pod row implementation. | 6 * @fileoverview User pod row implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 /** | 10 /** |
(...skipping 15 matching lines...) Expand all Loading... |
26 * @type {number} | 26 * @type {number} |
27 * @const | 27 * @const |
28 */ | 28 */ |
29 var WALLPAPER_LOAD_DELAY_MS = 500; | 29 var WALLPAPER_LOAD_DELAY_MS = 500; |
30 | 30 |
31 /** | 31 /** |
32 * Wallpaper load delay in milliseconds. TODO(nkostylev): Tune this constant. | 32 * Wallpaper load delay in milliseconds. TODO(nkostylev): Tune this constant. |
33 * @type {number} | 33 * @type {number} |
34 * @const | 34 * @const |
35 */ | 35 */ |
36 var WALLPAPER_BOAT_LOAD_DELAY_MS = 500; | 36 var WALLPAPER_BOOT_LOAD_DELAY_MS = 500; |
37 | 37 |
38 /** | 38 /** |
39 * Oauth token status. These must match UserManager::OAuthTokenStatus. | 39 * Oauth token status. These must match UserManager::OAuthTokenStatus. |
40 * @enum {number} | 40 * @enum {number} |
41 * @const | 41 * @const |
42 */ | 42 */ |
43 var OAuthTokenStatus = { | 43 var OAuthTokenStatus = { |
44 UNKNOWN: 0, | 44 UNKNOWN: 0, |
45 INVALID: 1, | 45 INVALID: 1, |
46 VALID: 2 | 46 VALID: 2 |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 this.loadWallpaper_.bind(this), WALLPAPER_LOAD_DELAY_MS); | 672 this.loadWallpaper_.bind(this), WALLPAPER_LOAD_DELAY_MS); |
673 } else { | 673 } else { |
674 if (!this.firstShown_) { | 674 if (!this.firstShown_) { |
675 // Load wallpaper immediately if there no pod was focused | 675 // Load wallpaper immediately if there no pod was focused |
676 // previously, and it is not a boot into user pod list case. | 676 // previously, and it is not a boot into user pod list case. |
677 this.loadWallpaper_(); | 677 this.loadWallpaper_(); |
678 } else { | 678 } else { |
679 // Boot transition. Delay wallpaper load to remove jank | 679 // Boot transition. Delay wallpaper load to remove jank |
680 // happening when wallpaper load is competing for resources with | 680 // happening when wallpaper load is competing for resources with |
681 // login WebUI. | 681 // login WebUI. |
682 this.loadWallpaperTimeout_ = window.setTimeout( | 682 if (Oobe.getInstance().shouldLoadWallpaperOnBoot()) { |
683 this.loadWallpaper_.bind(this), WALLPAPER_BOAT_LOAD_DELAY_MS); | 683 this.loadWallpaperTimeout_ = window.setTimeout( |
| 684 this.loadWallpaper_.bind(this), WALLPAPER_BOOT_LOAD_DELAY_MS); |
| 685 } |
684 this.firstShown_ = false; | 686 this.firstShown_ = false; |
685 } | 687 } |
686 } | 688 } |
687 } else { | 689 } else { |
688 chrome.send('userDeselected'); | 690 chrome.send('userDeselected'); |
689 } | 691 } |
690 this.insideFocusPod_ = false; | 692 this.insideFocusPod_ = false; |
691 }, | 693 }, |
692 | 694 |
693 loadWallpaper_: function() { | 695 loadWallpaper_: function() { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 chrome.send('loginVisible'); | 921 chrome.send('loginVisible'); |
920 }); | 922 }); |
921 } | 923 } |
922 } | 924 } |
923 }; | 925 }; |
924 | 926 |
925 return { | 927 return { |
926 PodRow: PodRow | 928 PodRow: PodRow |
927 }; | 929 }; |
928 }); | 930 }); |
OLD | NEW |