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({
ready() {
this.initializeLoginScreen('EnableAdbSideloadingScreen', {
noAnimatedTransition: true,
resetAllowed: true,
});
},
......
......@@ -15,30 +15,14 @@
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 {
visibility: hidden;
}
.faded,
.left,
.right {
.faded {
opacity: 0;
}
.step.right {
transform: translateX(50px);
}
.step.left {
transform: translateX(-50px)
}
.step.fullscreen {
height: 100%;
left: 0;
......
......@@ -2,7 +2,7 @@
Use of this source code is governed by a BSD-style license that can be
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>
<assistant-optin-flow id="assistant-optin-flow-card"></assistant-optin-flow>
</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>
<div class="step-contents">
<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">
<div class="step-contents" aria-live="polite" aria-atomic="true">
<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>
<oobe-eula-md id="oobe-eula-md"></oobe-eula-md>
</div>
......@@ -2,8 +2,8 @@
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<div class="step faded hidden" id="supervision-transition"
<div class="step hidden" id="supervision-transition"
role="group" hidden>
<supervision-transition-md id="supervision-transition-md">
</supervision-transition-md>
</div>
\ No newline at end of file
</div>
......@@ -95,7 +95,6 @@ Polymer({
resetAllowed: true,
enableDebuggingAllowed: true,
enterDemoModeAllowed: true,
noAnimatedTransition: true,
postponeEnrollmentAllowed: true,
});
this.updateLocalizedContent();
......
......@@ -2,7 +2,7 @@
Use of this source code is governed by a BSD-style license that can be
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>
</div>
......
......@@ -13,9 +13,9 @@
<include src="../../../../../../ui/login/account_picker/chromeos_screen_account_picker.html">
<include src="../screen_error_message.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>
<tpm-error-message id="tpm-error-message" class="step faded hidden">
<tpm-error-message id="tpm-error-message" class="step hidden">
</tpm-error-message>
<wrong-hwid id="wrong-hwid" class="step hidden"></wrong-hwid>
<include src="../screen_app_launch_splash.html">
......@@ -25,9 +25,9 @@
<device-disabled id="device-disabled" class="step hidden">
</device-disabled>
<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>
<recommend-apps id="recommend-apps" class="step right hidden" hidden>
<recommend-apps id="recommend-apps" class="step hidden" hidden>
</recommend-apps>
<include src="../screen_app_downloading.html">
<include src="../screen_discover.html">
......
......@@ -3,14 +3,14 @@
found in the LICENSE file. -->
<!-- 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>
<include src="../oobe_screen_supervision_transition.html">
<gaia-password-changed id="gaia-password-changed"
class="step faded hidden" hidden>
class="step hidden" hidden>
</gaia-password-changed>
<active-directory-password-change id="ad-password-change"
class="step faded hidden migrate" hidden>
class="step hidden migrate" hidden>
</active-directory-password-change>
<include src="../screen_encryption_migration.html">
<include src="../screen_update_required.html">
......@@ -7,14 +7,14 @@
<!-- Due to implementation details Welcome screen have to be first -->
<oobe-welcome-md id="connect" class="step hidden" hidden>
</oobe-welcome-md>
<hid-detection id="hid-detection" class="step right hidden">
<hid-detection id="hid-detection" class="step hidden">
</hid-detection>
<include src="../oobe_screen_enable_debugging.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>
<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>
<include src="../oobe_screen_auto_enrollment_check.html">
<include src="../oobe_screen_demo_preferences.html">
......
......@@ -123,17 +123,6 @@ cr.define('cr.ui.login', function() {
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
* would declare same method one of them will be hidden. Also, if element
......@@ -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.
* @param {number} nextStepIndex Index of the next step.
......@@ -565,32 +525,9 @@ cr.define('cr.ui.login', function() {
newStep.classList.remove('hidden');
var currentIsAnimated = !currentStepAttributes.noAnimatedTransition &&
this.screenIsAnimated_(currentStepId);
var newIsAnimated = !newStepAttributes.noAnimatedTransition &&
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');
}
}
// Start fading animation for login display or reset screen.
oldStep.classList.add('faded');
newStep.classList.remove('faded');
this.disableButtons_(newStep, false);
......@@ -605,30 +542,10 @@ cr.define('cr.ui.login', function() {
var isOOBE = this.isOobeUI();
if (this.currentStep_ != nextStepIndex &&
!oldStep.classList.contains('hidden')) {
if (oldStep.classList.contains('animated')) {
innerContainer.classList.add('animation');
oldStep.addEventListener('transitionend', function f(e) {
oldStep.removeEventListener('transitionend', f);
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();
}
oldStep.classList.add('hidden');
oldStep.hidden = true;
if (defaultControl)
defaultControl.focus();
} else {
// First screen on OOBE launch.
if (this.isOobeUI() && innerContainer.classList.contains('down')) {
......@@ -868,12 +785,6 @@ cr.define('cr.ui.login', function() {
* Prepares screens to use in login display.
*/
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) {
$('top-header-bar').hidden = true;
}
......
......@@ -11,7 +11,6 @@
* @typedef {{
* enableDebuggingAllowed: (boolean|undefined),
* enterDemoModeAllowed: (boolean|undefined),
* noAnimatedTransition: (boolean|undefined),
* postponeEnrollmentAllowed: (boolean|undefined),
* resetAllowed: (boolean|undefined),
* startEnrollmentAllowed: (boolean|undefined),
......@@ -33,12 +32,6 @@ DisplayManagerScreenAttributes.enableDebuggingAllowed;
*/
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.
* @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