Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: ui/login/display_manager.js

Issue 2535493002: Reduce webkit CSS prefixes in ui/ styles (Closed)
Patch Set: js Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 /** @const */ var USER_ACTION_ROLLBACK_TOGGLED = 'rollback-toggled'; 93 /** @const */ var USER_ACTION_ROLLBACK_TOGGLED = 'rollback-toggled';
94 94
95 cr.define('cr.ui.login', function() { 95 cr.define('cr.ui.login', function() {
96 var Bubble = cr.ui.Bubble; 96 var Bubble = cr.ui.Bubble;
97 97
98 /** 98 /**
99 * Maximum time in milliseconds to wait for step transition to finish. 99 * Maximum time in milliseconds to wait for step transition to finish.
100 * The value is used as the duration for ensureTransitionEndEvent below. 100 * The value is used as the duration for ensureTransitionEndEvent below.
101 * It needs to be inline with the step screen transition duration time 101 * It needs to be inline with the step screen transition duration time
102 * defined in css file. The current value in css is 200ms. To avoid emulated 102 * defined in css file. The current value in css is 200ms. To avoid emulated
103 * webkitTransitionEnd fired before real one, 250ms is used. 103 * transitionend fired before real one, 250ms is used.
104 * @const 104 * @const
105 */ 105 */
106 var MAX_SCREEN_TRANSITION_DURATION = 250; 106 var MAX_SCREEN_TRANSITION_DURATION = 250;
107 107
108 /** 108 /**
109 * Groups of screens (screen IDs) that should have the same dimensions. 109 * Groups of screens (screen IDs) that should have the same dimensions.
110 * @type Array<Array<string>> 110 * @type Array<Array<string>>
111 * @const 111 * @const
112 */ 112 */
113 var SCREEN_GROUPS = [[SCREEN_OOBE_NETWORK, 113 var SCREEN_GROUPS = [[SCREEN_OOBE_NETWORK,
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // Default control to be focused (if specified). 528 // Default control to be focused (if specified).
529 var defaultControl = newStep.defaultControl; 529 var defaultControl = newStep.defaultControl;
530 530
531 var outerContainer = $('outer-container'); 531 var outerContainer = $('outer-container');
532 var innerContainer = $('inner-container'); 532 var innerContainer = $('inner-container');
533 var isOOBE = this.isOobeUI(); 533 var isOOBE = this.isOobeUI();
534 if (this.currentStep_ != nextStepIndex && 534 if (this.currentStep_ != nextStepIndex &&
535 !oldStep.classList.contains('hidden')) { 535 !oldStep.classList.contains('hidden')) {
536 if (oldStep.classList.contains('animated')) { 536 if (oldStep.classList.contains('animated')) {
537 innerContainer.classList.add('animation'); 537 innerContainer.classList.add('animation');
538 oldStep.addEventListener('webkitTransitionEnd', function f(e) { 538 oldStep.addEventListener('transitionend', function f(e) {
539 oldStep.removeEventListener('webkitTransitionEnd', f); 539 oldStep.removeEventListener('transitionend', f);
540 if (oldStep.classList.contains('faded') || 540 if (oldStep.classList.contains('faded') ||
541 oldStep.classList.contains('left') || 541 oldStep.classList.contains('left') ||
542 oldStep.classList.contains('right')) { 542 oldStep.classList.contains('right')) {
543 innerContainer.classList.remove('animation'); 543 innerContainer.classList.remove('animation');
544 oldStep.classList.add('hidden'); 544 oldStep.classList.add('hidden');
545 if (!isOOBE) 545 if (!isOOBE)
546 oldStep.hidden = true; 546 oldStep.hidden = true;
547 } 547 }
548 // Refresh defaultControl. It could have changed. 548 // Refresh defaultControl. It could have changed.
549 var defaultControl = newStep.defaultControl; 549 var defaultControl = newStep.defaultControl;
550 if (defaultControl) 550 if (defaultControl)
551 defaultControl.focus(); 551 defaultControl.focus();
552 }); 552 });
553 ensureTransitionEndEvent(oldStep, MAX_SCREEN_TRANSITION_DURATION); 553 ensureTransitionEndEvent(oldStep, MAX_SCREEN_TRANSITION_DURATION);
554 } else { 554 } else {
555 oldStep.classList.add('hidden'); 555 oldStep.classList.add('hidden');
556 oldStep.hidden = true; 556 oldStep.hidden = true;
557 if (defaultControl) 557 if (defaultControl)
558 defaultControl.focus(); 558 defaultControl.focus();
559 } 559 }
560 } else { 560 } else {
561 // First screen on OOBE launch. 561 // First screen on OOBE launch.
562 if (this.isOobeUI() && innerContainer.classList.contains('down')) { 562 if (this.isOobeUI() && innerContainer.classList.contains('down')) {
563 innerContainer.classList.remove('down'); 563 innerContainer.classList.remove('down');
564 innerContainer.addEventListener( 564 innerContainer.addEventListener(
565 'webkitTransitionEnd', function f(e) { 565 'transitionend', function f(e) {
566 innerContainer.removeEventListener('webkitTransitionEnd', f); 566 innerContainer.removeEventListener('transitionend', f);
567 outerContainer.classList.remove('down'); 567 outerContainer.classList.remove('down');
568 $('progress-dots').classList.remove('down'); 568 $('progress-dots').classList.remove('down');
569 chrome.send('loginVisible', ['oobe']); 569 chrome.send('loginVisible', ['oobe']);
570 // Refresh defaultControl. It could have changed. 570 // Refresh defaultControl. It could have changed.
571 var defaultControl = newStep.defaultControl; 571 var defaultControl = newStep.defaultControl;
572 if (defaultControl) 572 if (defaultControl)
573 defaultControl.focus(); 573 defaultControl.focus();
574 }); 574 });
575 ensureTransitionEndEvent(innerContainer, 575 ensureTransitionEndEvent(innerContainer,
576 MAX_SCREEN_TRANSITION_DURATION); 576 MAX_SCREEN_TRANSITION_DURATION);
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 */ 1059 */
1060 DisplayManager.refocusCurrentPod = function() { 1060 DisplayManager.refocusCurrentPod = function() {
1061 $('pod-row').refocusCurrentPod(); 1061 $('pod-row').refocusCurrentPod();
1062 }; 1062 };
1063 1063
1064 // Export 1064 // Export
1065 return { 1065 return {
1066 DisplayManager: DisplayManager 1066 DisplayManager: DisplayManager
1067 }; 1067 };
1068 }); 1068 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698