Commit b5ad180a authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

oobe: remove unused screen switching transitions code

Bug: 1067260, 1097706
Change-Id: I016e5bc36e3e185730c29e5a7373a2c8e7519924
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2273129
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#783890}
parent 8ba5dd1b
...@@ -47,7 +47,6 @@ Polymer({ ...@@ -47,7 +47,6 @@ Polymer({
ready() { ready() {
this.initializeLoginScreen('EnableAdbSideloadingScreen', { this.initializeLoginScreen('EnableAdbSideloadingScreen', {
noAnimatedTransition: true,
resetAllowed: true, resetAllowed: true,
}); });
}, },
......
...@@ -15,30 +15,14 @@ ...@@ -15,30 +15,14 @@
user-select: none; user-select: none;
} }
.step.animated:not(.faded) {
transition: transform 200ms ease-in-out,
opacity 200ms ease-in-out,
visibility 200ms ease-in-out;
}
.step.hidden { .step.hidden {
visibility: hidden; visibility: hidden;
} }
.faded, .faded {
.left,
.right {
opacity: 0; opacity: 0;
} }
.step.right {
transform: translateX(50px);
}
.step.left {
transform: translateX(-50px)
}
.step.fullscreen { .step.fullscreen {
height: 100%; height: 100%;
left: 0; left: 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<div class="step faded hidden" id="assistant-optin-flow" <div class="step hidden" id="assistant-optin-flow"
role="group" hidden> role="group" hidden>
<assistant-optin-flow id="assistant-optin-flow-card"></assistant-optin-flow> <assistant-optin-flow id="assistant-optin-flow-card"></assistant-optin-flow>
</div> </div>
<div class="step right hidden animated" id="auto-enrollment-check" role="group" <div class="step hidden" id="auto-enrollment-check" role="group"
i18n-values="aria-label:autoEnrollmentCheckScreenHeader" hidden> i18n-values="aria-label:autoEnrollmentCheckScreenHeader" hidden>
<div class="step-contents"> <div class="step-contents">
<div id="auto-enrollment-check-progress" aria-live="polite"> <div id="auto-enrollment-check-progress" aria-live="polite">
......
<div class="step faded hidden" id="debugging" role="group" hidden <div class="step hidden" id="debugging" role="group" hidden
i18n-values="aria-label:enableDebuggingScreenAccessibleTitle"> i18n-values="aria-label:enableDebuggingScreenAccessibleTitle">
<div class="step-contents" aria-live="polite" aria-atomic="true"> <div class="step-contents" aria-live="polite" aria-atomic="true">
<div id="enable-debugging-icon"></div> <div id="enable-debugging-icon"></div>
......
<div class="step right hidden animated" id="eula" role="group" <div class="step hidden" id="eula" role="group"
i18n-values="aria-label:eulaScreenAccessibleTitle" hidden> i18n-values="aria-label:eulaScreenAccessibleTitle" hidden>
<oobe-eula-md id="oobe-eula-md"></oobe-eula-md> <oobe-eula-md id="oobe-eula-md"></oobe-eula-md>
</div> </div>
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<div class="step faded hidden" id="supervision-transition" <div class="step hidden" id="supervision-transition"
role="group" hidden> role="group" hidden>
<supervision-transition-md id="supervision-transition-md"> <supervision-transition-md id="supervision-transition-md">
</supervision-transition-md> </supervision-transition-md>
</div> </div>
\ No newline at end of file
...@@ -95,7 +95,6 @@ Polymer({ ...@@ -95,7 +95,6 @@ Polymer({
resetAllowed: true, resetAllowed: true,
enableDebuggingAllowed: true, enableDebuggingAllowed: true,
enterDemoModeAllowed: true, enterDemoModeAllowed: true,
noAnimatedTransition: true,
postponeEnrollmentAllowed: true, postponeEnrollmentAllowed: true,
}); });
this.updateLocalizedContent(); this.updateLocalizedContent();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Use of this source code is governed by a BSD-style license that can be Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<div class="step faded" id="update-required" hidden> <div class="step hidden" id="update-required" hidden>
<update-required-card id="update-required-card"> <update-required-card id="update-required-card">
</update-required-card> </update-required-card>
</div> </div>
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<include src="../../../../../../ui/login/account_picker/chromeos_screen_account_picker.html"> <include src="../../../../../../ui/login/account_picker/chromeos_screen_account_picker.html">
<include src="../screen_error_message.html"> <include src="../screen_error_message.html">
<include src="../screen_arc_terms_of_service.html"> <include src="../screen_arc_terms_of_service.html">
<gaia-signin id="gaia-signin" class="step right hidden" hidden> <gaia-signin id="gaia-signin" class="step hidden" hidden>
</gaia-signin> </gaia-signin>
<tpm-error-message id="tpm-error-message" class="step faded hidden"> <tpm-error-message id="tpm-error-message" class="step hidden">
</tpm-error-message> </tpm-error-message>
<wrong-hwid id="wrong-hwid" class="step hidden"></wrong-hwid> <wrong-hwid id="wrong-hwid" class="step hidden"></wrong-hwid>
<include src="../screen_app_launch_splash.html"> <include src="../screen_app_launch_splash.html">
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<device-disabled id="device-disabled" class="step hidden"> <device-disabled id="device-disabled" class="step hidden">
</device-disabled> </device-disabled>
<include src="../screen_sync_consent.html"> <include src="../screen_sync_consent.html">
<fingerprint-setup id="fingerprint-setup" class="step right hidden" hidden> <fingerprint-setup id="fingerprint-setup" class="step hidden" hidden>
</fingerprint-setup> </fingerprint-setup>
<recommend-apps id="recommend-apps" class="step right hidden" hidden> <recommend-apps id="recommend-apps" class="step hidden" hidden>
</recommend-apps> </recommend-apps>
<include src="../screen_app_downloading.html"> <include src="../screen_app_downloading.html">
<include src="../screen_discover.html"> <include src="../screen_discover.html">
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
found in the LICENSE file. --> found in the LICENSE file. -->
<!-- Login-specific screens --> <!-- Login-specific screens -->
<terms-of-service id="terms-of-service" class="step right hidden"> <terms-of-service id="terms-of-service" class="step hidden">
</terms-of-service> </terms-of-service>
<include src="../oobe_screen_supervision_transition.html"> <include src="../oobe_screen_supervision_transition.html">
<gaia-password-changed id="gaia-password-changed" <gaia-password-changed id="gaia-password-changed"
class="step faded hidden" hidden> class="step hidden" hidden>
</gaia-password-changed> </gaia-password-changed>
<active-directory-password-change id="ad-password-change" <active-directory-password-change id="ad-password-change"
class="step faded hidden migrate" hidden> class="step hidden migrate" hidden>
</active-directory-password-change> </active-directory-password-change>
<include src="../screen_encryption_migration.html"> <include src="../screen_encryption_migration.html">
<include src="../screen_update_required.html"> <include src="../screen_update_required.html">
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<!-- Due to implementation details Welcome screen have to be first --> <!-- Due to implementation details Welcome screen have to be first -->
<oobe-welcome-md id="connect" class="step hidden" hidden> <oobe-welcome-md id="connect" class="step hidden" hidden>
</oobe-welcome-md> </oobe-welcome-md>
<hid-detection id="hid-detection" class="step right hidden"> <hid-detection id="hid-detection" class="step hidden">
</hid-detection> </hid-detection>
<include src="../oobe_screen_enable_debugging.html"> <include src="../oobe_screen_enable_debugging.html">
<include src="../oobe_screen_demo_setup.html"> <include src="../oobe_screen_demo_setup.html">
<oobe-network id="network-selection" class="step hidden animated" hidden> <oobe-network id="network-selection" class="step hidden" hidden>
</oobe-network> </oobe-network>
<include src="../oobe_screen_eula.html"> <include src="../oobe_screen_eula.html">
<oobe-update id="oobe-update" class="step right hidden animated" hidden> <oobe-update id="oobe-update" class="step hidden" hidden>
</oobe-update> </oobe-update>
<include src="../oobe_screen_auto_enrollment_check.html"> <include src="../oobe_screen_auto_enrollment_check.html">
<include src="../oobe_screen_demo_preferences.html"> <include src="../oobe_screen_demo_preferences.html">
......
...@@ -123,17 +123,6 @@ cr.define('cr.ui.login', function() { ...@@ -123,17 +123,6 @@ cr.define('cr.ui.login', function() {
SCREEN_OOBE_UPDATE SCREEN_OOBE_UPDATE
]; ];
/**
* Group of screens (screen IDs) that are not participating in
* left-current-right animation.
* @type Array<string>
* @const
*/
var NOT_ANIMATED_SCREEN_GROUP = [
SCREEN_OOBE_ENABLE_DEBUGGING,
SCREEN_OOBE_RESET,
];
/** /**
* As Polymer behaviors do not provide true inheritance, when two behaviors * As Polymer behaviors do not provide true inheritance, when two behaviors
* would declare same method one of them will be hidden. Also, if element * would declare same method one of them will be hidden. Also, if element
...@@ -488,35 +477,6 @@ cr.define('cr.ui.login', function() { ...@@ -488,35 +477,6 @@ cr.define('cr.ui.login', function() {
} }
}, },
screenIsAnimated_: function(screenId) {
return NOT_ANIMATED_SCREEN_GROUP.indexOf(screenId) != -1;
},
/**
* Updates a step's css classes to reflect left, current, or right position.
* @param {number} stepIndex step index.
* @param {string} state one of 'left', 'current', 'right'.
*/
updateStep_: function(stepIndex, state) {
var stepId = this.screens_[stepIndex];
var step = $(stepId);
var header = $('header-' + stepId);
var states = ['left', 'right', 'current'];
for (var i = 0; i < states.length; ++i) {
if (states[i] != state) {
step.classList.remove(states[i]);
if (header) {
header.classList.remove(states[i]);
}
}
}
step.classList.add(state);
if (header) {
header.classList.add(state);
}
},
/** /**
* Switches to the next OOBE step. * Switches to the next OOBE step.
* @param {number} nextStepIndex Index of the next step. * @param {number} nextStepIndex Index of the next step.
...@@ -565,32 +525,9 @@ cr.define('cr.ui.login', function() { ...@@ -565,32 +525,9 @@ cr.define('cr.ui.login', function() {
newStep.classList.remove('hidden'); newStep.classList.remove('hidden');
var currentIsAnimated = !currentStepAttributes.noAnimatedTransition && // Start fading animation for login display or reset screen.
this.screenIsAnimated_(currentStepId); oldStep.classList.add('faded');
var newIsAnimated = !newStepAttributes.noAnimatedTransition && newStep.classList.remove('faded');
this.screenIsAnimated_(nextStepId);
if (this.isOobeUI() && currentIsAnimated && newIsAnimated) {
// Start gliding animation for OOBE steps.
if (nextStepIndex > this.currentStep_) {
for (var i = this.currentStep_; i < nextStepIndex; ++i)
this.updateStep_(i, 'left');
this.updateStep_(nextStepIndex, 'current');
} else if (nextStepIndex < this.currentStep_) {
for (var i = this.currentStep_; i > nextStepIndex; --i)
this.updateStep_(i, 'right');
this.updateStep_(nextStepIndex, 'current');
}
} else {
// Start fading animation for login display or reset screen.
oldStep.classList.add('faded');
newStep.classList.remove('faded');
if (newStepAttributes.noAnimatedTransition ||
!this.screenIsAnimated_(nextStepId)) {
newStep.classList.remove('left');
newStep.classList.remove('right');
}
}
this.disableButtons_(newStep, false); this.disableButtons_(newStep, false);
...@@ -605,30 +542,10 @@ cr.define('cr.ui.login', function() { ...@@ -605,30 +542,10 @@ cr.define('cr.ui.login', function() {
var isOOBE = this.isOobeUI(); var isOOBE = this.isOobeUI();
if (this.currentStep_ != nextStepIndex && if (this.currentStep_ != nextStepIndex &&
!oldStep.classList.contains('hidden')) { !oldStep.classList.contains('hidden')) {
if (oldStep.classList.contains('animated')) { oldStep.classList.add('hidden');
innerContainer.classList.add('animation'); oldStep.hidden = true;
oldStep.addEventListener('transitionend', function f(e) { if (defaultControl)
oldStep.removeEventListener('transitionend', f); defaultControl.focus();
if (oldStep.classList.contains('faded') ||
oldStep.classList.contains('left') ||
oldStep.classList.contains('right')) {
innerContainer.classList.remove('animation');
oldStep.classList.add('hidden');
if (!isOOBE)
oldStep.hidden = true;
}
// Refresh defaultControl. It could have changed.
var defaultControl = newStep.defaultControl;
if (defaultControl)
defaultControl.focus();
});
ensureTransitionEndEvent(oldStep, MAX_SCREEN_TRANSITION_DURATION);
} else {
oldStep.classList.add('hidden');
oldStep.hidden = true;
if (defaultControl)
defaultControl.focus();
}
} else { } else {
// First screen on OOBE launch. // First screen on OOBE launch.
if (this.isOobeUI() && innerContainer.classList.contains('down')) { if (this.isOobeUI() && innerContainer.classList.contains('down')) {
...@@ -868,12 +785,6 @@ cr.define('cr.ui.login', function() { ...@@ -868,12 +785,6 @@ cr.define('cr.ui.login', function() {
* Prepares screens to use in login display. * Prepares screens to use in login display.
*/ */
prepareForLoginDisplay_: function() { prepareForLoginDisplay_: function() {
for (var i = 0, screenId; screenId = this.screens_[i]; ++i) {
var screen = $(screenId);
screen.classList.add('faded');
screen.classList.remove('right');
screen.classList.remove('left');
}
if (this.showingViewsLogin) { if (this.showingViewsLogin) {
$('top-header-bar').hidden = true; $('top-header-bar').hidden = true;
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
* @typedef {{ * @typedef {{
* enableDebuggingAllowed: (boolean|undefined), * enableDebuggingAllowed: (boolean|undefined),
* enterDemoModeAllowed: (boolean|undefined), * enterDemoModeAllowed: (boolean|undefined),
* noAnimatedTransition: (boolean|undefined),
* postponeEnrollmentAllowed: (boolean|undefined), * postponeEnrollmentAllowed: (boolean|undefined),
* resetAllowed: (boolean|undefined), * resetAllowed: (boolean|undefined),
* startEnrollmentAllowed: (boolean|undefined), * startEnrollmentAllowed: (boolean|undefined),
...@@ -33,12 +32,6 @@ DisplayManagerScreenAttributes.enableDebuggingAllowed; ...@@ -33,12 +32,6 @@ DisplayManagerScreenAttributes.enableDebuggingAllowed;
*/ */
DisplayManagerScreenAttributes.enterDemoModeAllowed; DisplayManagerScreenAttributes.enterDemoModeAllowed;
/**
* True if screen does not use left-current-right animation.
* @type {boolean|undefined}
*/
DisplayManagerScreenAttributes.noAnimatedTransition;
/** /**
* True if enrollment accelerator should schedule postponed enrollment. * True if enrollment accelerator should schedule postponed enrollment.
* @type {boolean|undefined} * @type {boolean|undefined}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment