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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 if (!podRow.preselectedPod) | 112 if (!podRow.preselectedPod) |
113 this.onShow(); | 113 this.onShow(); |
114 }, | 114 }, |
115 | 115 |
116 /** | 116 /** |
117 * Event handler invoked when the page is shown and ready. | 117 * Event handler invoked when the page is shown and ready. |
118 */ | 118 */ |
119 onShow: function() { | 119 onShow: function() { |
120 if (!this.firstShown_) return; | 120 if (!this.firstShown_) return; |
121 this.firstShown_ = false; | 121 this.firstShown_ = false; |
122 // TODO(nkostylev): Enable animation back when session start jank | |
123 // is reduced. See http://crosbug.com/11116 http://crosbug.com/18307 | |
124 // $('pod-row').startInitAnimation(); | |
125 | 122 |
126 // Ensure that login is actually visible. | 123 // Ensure that login is actually visible. |
127 window.webkitRequestAnimationFrame(function() { | 124 window.webkitRequestAnimationFrame(function() { |
128 chrome.send('accountPickerReady'); | 125 chrome.send('accountPickerReady'); |
129 chrome.send('loginVisible', ['account-picker']); | 126 chrome.send('loginVisible', ['account-picker']); |
130 }); | 127 }); |
131 }, | 128 }, |
132 | 129 |
133 /** | 130 /** |
134 * Event handler that is invoked just before the frame is hidden. | 131 * Event handler that is invoked just before the frame is hidden. |
(...skipping 28 matching lines...) Expand all Loading... |
163 $('bubble').showContentForElement(activatedPod.mainInput, | 160 $('bubble').showContentForElement(activatedPod.mainInput, |
164 cr.ui.Bubble.Attachment.BOTTOM, | 161 cr.ui.Bubble.Attachment.BOTTOM, |
165 error, | 162 error, |
166 BUBBLE_OFFSET, BUBBLE_PADDING); | 163 BUBBLE_OFFSET, BUBBLE_PADDING); |
167 } | 164 } |
168 }, | 165 }, |
169 | 166 |
170 /** | 167 /** |
171 * Loads given users in pod row. | 168 * Loads given users in pod row. |
172 * @param {array} users Array of user. | 169 * @param {array} users Array of user. |
173 * @param {boolean} animated Whether to use init animation. | |
174 * @param {boolean} showGuest Whether to show guest session button. | 170 * @param {boolean} showGuest Whether to show guest session button. |
175 */ | 171 */ |
176 loadUsers: function(users, animated, showGuest) { | 172 loadUsers: function(users, showGuest) { |
177 $('pod-row').loadPods(users, animated); | 173 $('pod-row').loadPods(users); |
178 $('login-header-bar').showGuestButton = showGuest; | 174 $('login-header-bar').showGuestButton = showGuest; |
179 | 175 |
180 // The desktop User Manager can send the index of a pod that should be | 176 // The desktop User Manager can send the index of a pod that should be |
181 // initially focused. | 177 // initially focused. |
182 var hash = window.location.hash; | 178 var hash = window.location.hash; |
183 if (hash) { | 179 if (hash) { |
184 var podIndex = hash.substr(1); | 180 var podIndex = hash.substr(1); |
185 if (podIndex) | 181 if (podIndex) |
186 $('pod-row').focusPodByIndex(podIndex, false); | 182 $('pod-row').focusPodByIndex(podIndex, false); |
187 } | 183 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 303 |
308 /** | 304 /** |
309 * Shows a tooltip bubble explaining Easy Unlock. | 305 * Shows a tooltip bubble explaining Easy Unlock. |
310 */ | 306 */ |
311 showEasyUnlockBubble: function() { | 307 showEasyUnlockBubble: function() { |
312 $('pod-row').showEasyUnlockBubble(); | 308 $('pod-row').showEasyUnlockBubble(); |
313 } | 309 } |
314 }; | 310 }; |
315 }); | 311 }); |
316 | 312 |
OLD | NEW |