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 Display manager for WebUI OOBE and login. | 6 * @fileoverview Display manager for WebUI OOBE and login. |
7 */ | 7 */ |
8 | 8 |
9 // TODO(xiyuan): Find a better to share those constants. | 9 // TODO(xiyuan): Find a better to share those constants. |
10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; | 10 /** @const */ var SCREEN_OOBE_NETWORK = 'connect'; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 } else { | 211 } else { |
212 // Start fading animation for login display. | 212 // Start fading animation for login display. |
213 oldStep.classList.add('faded'); | 213 oldStep.classList.add('faded'); |
214 newStep.classList.remove('faded'); | 214 newStep.classList.remove('faded'); |
215 } | 215 } |
216 | 216 |
217 // Adjust inner container height based on new step's height. | 217 // Adjust inner container height based on new step's height. |
218 this.updateInnerContainerSize_(newStep); | 218 this.updateInnerContainerSize_(newStep); |
219 | 219 |
| 220 var innerContainer = $('inner-container'); |
220 if (this.currentStep_ != nextStepIndex && | 221 if (this.currentStep_ != nextStepIndex && |
221 !oldStep.classList.contains('hidden')) { | 222 !oldStep.classList.contains('hidden')) { |
222 if (oldStep.classList.contains('animated') || !this.isNewOobe()) { | 223 if (oldStep.classList.contains('animated') || !this.isNewOobe()) { |
223 oldStep.classList.add('animation'); | 224 innerContainer.classList.add('animation'); |
224 oldStep.addEventListener('webkitTransitionEnd', function f(e) { | 225 oldStep.addEventListener('webkitTransitionEnd', function f(e) { |
225 oldStep.removeEventListener('webkitTransitionEnd', f); | 226 oldStep.removeEventListener('webkitTransitionEnd', f); |
226 if (oldStep.classList.contains('faded') || | 227 if (oldStep.classList.contains('faded') || |
227 oldStep.classList.contains('left') || | 228 oldStep.classList.contains('left') || |
228 oldStep.classList.contains('right')) { | 229 oldStep.classList.contains('right')) { |
229 oldStep.classList.remove('animation'); | 230 innerContainer.classList.remove('animation'); |
230 oldStep.classList.add('hidden'); | 231 oldStep.classList.add('hidden'); |
231 } | 232 } |
232 }); | 233 }); |
233 } else { | 234 } else { |
234 oldStep.classList.add('hidden'); | 235 oldStep.classList.add('hidden'); |
235 } | 236 } |
236 } else { | 237 } else { |
237 // First screen on OOBE launch. | 238 // First screen on OOBE launch. |
238 var innerContainer = $('inner-container'); | |
239 innerContainer.classList.remove('down'); | 239 innerContainer.classList.remove('down'); |
240 innerContainer.addEventListener( | 240 innerContainer.addEventListener( |
241 'webkitTransitionEnd', function f(e) { | 241 'webkitTransitionEnd', function f(e) { |
242 innerContainer.removeEventListener('webkitTransitionEnd', f); | 242 innerContainer.removeEventListener('webkitTransitionEnd', f); |
243 $('progress-dots').classList.remove('down'); | 243 $('progress-dots').classList.remove('down'); |
244 }); | 244 }); |
245 newHeader.classList.remove('right'); // Old OOBE. | 245 newHeader.classList.remove('right'); // Old OOBE. |
246 // Report back first OOBE screen being painted. | 246 // Report back first OOBE screen being painted. |
247 window.webkitRequestAnimationFrame(function() { | 247 window.webkitRequestAnimationFrame(function() { |
248 chrome.send('loginVisible'); | 248 chrome.send('loginVisible'); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 }); | 552 }); |
553 } | 553 } |
554 } | 554 } |
555 }; | 555 }; |
556 | 556 |
557 // Export | 557 // Export |
558 return { | 558 return { |
559 DisplayManager: DisplayManager | 559 DisplayManager: DisplayManager |
560 }; | 560 }; |
561 }); | 561 }); |
OLD | NEW |