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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 oldStep.classList.contains('right')) { | 228 oldStep.classList.contains('right')) { |
229 oldStep.classList.remove('animation'); | 229 oldStep.classList.remove('animation'); |
230 oldStep.classList.add('hidden'); | 230 oldStep.classList.add('hidden'); |
231 } | 231 } |
232 }); | 232 }); |
233 } else { | 233 } else { |
234 oldStep.classList.add('hidden'); | 234 oldStep.classList.add('hidden'); |
235 } | 235 } |
236 } else { | 236 } else { |
237 // First screen on OOBE launch. | 237 // First screen on OOBE launch. |
238 $('inner-container').classList.remove('down'); | 238 var innerContainer = $('inner-container'); |
239 newHeader.classList.remove('right'); | 239 innerContainer.classList.remove('down'); |
| 240 innerContainer.addEventListener( |
| 241 'webkitTransitionEnd', function f(e) { |
| 242 innerContainer.removeEventListener('webkitTransitionEnd', f); |
| 243 $('progress-dots').classList.remove('down'); |
| 244 }); |
| 245 newHeader.classList.remove('right'); // Old OOBE. |
240 // Report back first OOBE screen being painted. | 246 // Report back first OOBE screen being painted. |
241 window.webkitRequestAnimationFrame(function() { | 247 window.webkitRequestAnimationFrame(function() { |
242 chrome.send('loginVisible'); | 248 chrome.send('loginVisible'); |
243 }); | 249 }); |
244 } | 250 } |
245 this.currentStep_ = nextStepIndex; | 251 this.currentStep_ = nextStepIndex; |
246 $('oobe').className = nextStepId; | 252 $('oobe').className = nextStepId; |
247 | 253 |
248 $('step-logo').hidden = newStep.classList.contains('no-logo'); | 254 $('step-logo').hidden = newStep.classList.contains('no-logo'); |
249 }, | 255 }, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 319 |
314 /** | 320 /** |
315 * Updates inner container size based on the size of the current screen and | 321 * Updates inner container size based on the size of the current screen and |
316 * other screens in the same group. | 322 * other screens in the same group. |
317 * Should be executed on screen change / screen size change. | 323 * Should be executed on screen change / screen size change. |
318 * @param {!HTMLElement} screen Screen that is being shown. | 324 * @param {!HTMLElement} screen Screen that is being shown. |
319 */ | 325 */ |
320 updateInnerContainerSize_: function(screen) { | 326 updateInnerContainerSize_: function(screen) { |
321 var height = screen.offsetHeight; | 327 var height = screen.offsetHeight; |
322 var width = screen.offsetWidth; | 328 var width = screen.offsetWidth; |
323 for (var i = 0, screenGroup; screenGroup = SCREEN_GROUPS[i]; i++) { | 329 if (this.isNewOobe()) { |
324 if (screenGroup.indexOf(screen.id) != -1) { | 330 for (var i = 0, screenGroup; screenGroup = SCREEN_GROUPS[i]; i++) { |
325 // Set screen dimensions to maximum dimensions within this group. | 331 if (screenGroup.indexOf(screen.id) != -1) { |
326 for (var j = 0, screen2; screen2 = $(screenGroup[j]); j++) { | 332 // Set screen dimensions to maximum dimensions within this group. |
327 height = Math.max(height, screen2.offsetHeight); | 333 for (var j = 0, screen2; screen2 = $(screenGroup[j]); j++) { |
328 width = Math.max(width, screen2.offsetWidth); | 334 height = Math.max(height, screen2.offsetHeight); |
| 335 width = Math.max(width, screen2.offsetWidth); |
| 336 } |
| 337 break; |
329 } | 338 } |
330 break; | |
331 } | 339 } |
332 } | 340 } |
333 $('inner-container').style.height = height + 'px'; | 341 $('inner-container').style.height = height + 'px'; |
334 if (this.isNewOobe()) { | 342 if (this.isNewOobe()) { |
335 $('inner-container').style.width = width + 'px'; | 343 $('inner-container').style.width = width + 'px'; |
336 // This requires |screen| to have |box-sizing: border-box|. | 344 // This requires |screen| to have 'box-sizing: border-box'. |
337 screen.style.width = width + 'px'; | 345 screen.style.width = width + 'px'; |
338 screen.style.height = height + 'px'; | 346 screen.style.height = height + 'px'; |
339 } | 347 } |
340 }, | 348 }, |
341 | 349 |
342 /** | 350 /** |
343 * Updates localized content of the screens like headers, buttons and links. | 351 * Updates localized content of the screens like headers, buttons and links. |
344 * Should be executed on language change. | 352 * Should be executed on language change. |
345 */ | 353 */ |
346 updateLocalizedContent_: function() { | 354 updateLocalizedContent_: function() { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 }); | 552 }); |
545 } | 553 } |
546 } | 554 } |
547 }; | 555 }; |
548 | 556 |
549 // Export | 557 // Export |
550 return { | 558 return { |
551 DisplayManager: DisplayManager | 559 DisplayManager: DisplayManager |
552 }; | 560 }; |
553 }); | 561 }); |
OLD | NEW |