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

Restore gaia-screen behavior when switching from Loading step

Bug: 981472
Change-Id: I9e73a1d482d7c796e0987b3b54c0ca606479c4bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1932544
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Cr-Commit-Position: refs/heads/master@{#719171}
parent 9fc8db2c
......@@ -97,7 +97,6 @@
position: absolute;
right: 0;
top: 0;
visibility: hidden;
}
:host(.saml) #signin-frame-container {
......
......@@ -11,7 +11,7 @@
<oobe-dialog id="signin-frame-dialog" class="gaia-dialog" role="dialog"
has-buttons no-header no-footer-padding
show-buttons-overlay="[[!navigationEnabled_]]"
hidden="[[!eq_(step_, 'online-gaia')]]">
hidden="[[!isStep_(step_, 'online-gaia', 'gaia-loading')]]">
<div slot="footer" class="flex layout vertical">
<div id="signin-frame-container"
class$="[[getSigninFrameContainerClass_(isLoadingUiShown_)]]">
......@@ -40,29 +40,29 @@
</div>
</oobe-dialog>
<offline-gaia id="offline-gaia" class="gaia-dialog"
hidden="[[!eq_(step_, 'offline-gaia')]]">
hidden="[[!isStep_(step_, 'offline-gaia')]]">
</offline-gaia>
<offline-ad-login id="offline-ad-auth" class="gaia-dialog"
hidden="[[!eq_(step_, 'ad')]]"
hidden="[[!isStep_(step_, 'ad')]]"
i18n-values="ad-welcome-message:loginWelcomeMessage">
</offline-ad-login>
<security-token-pin id="pinDialog" parameters="[[pinDialogParameters_]]"
hidden="[[!eq_(step_, 'pin')]]"
hidden="[[!isStep_(step_, 'pin')]]"
on-cancel="onPinDialogCanceled_" on-completed="onPinDialogCompleted_">
</security-token-pin>
<div id="gaia-step-contents" class="step-contents"
hidden="[[!eq_(step_, 'saml-interstitial')]]">
hidden="[[!isStep_(step_, 'saml-interstitial')]]">
<div id="gaia-signin-form-container">
<saml-interstitial id="saml-interstitial" class="fit gaia-dialog">
</saml-interstitial>
</div>
</div>
<div id="gaia-loading" class="step-loading gaia-dialog"
hidden="[[!eq_(step_, 'loading')]]">
hidden="[[!isStep_(step_, 'loading', 'gaia-loading')]]">
<throbber-notice i18n-values="text:gaiaLoading"></throbber-notice>
</div>
<notification-card id="gaia-whitelist-error" type="fail" class="gaia-dialog"
hidden="[[!eq_(step_, 'whitelist-error')]]"
hidden="[[!isStep_(step_, 'whitelist-error')]]"
i18n-values="button-label:tryAgainButton;
link-label:learnMoreButton">
</notification-card>
......
......@@ -60,6 +60,7 @@ const DialogMode = {
GAIA: 'online-gaia',
OFFLINE_GAIA: 'offline-gaia',
OFFLINE_AD: 'ad',
GAIA_LOADING: 'gaia-loading',
LOADING: 'loading',
PIN_DIALOG: 'pin',
GAIA_WHITELIST_ERROR: 'whitelist-error',
......@@ -94,6 +95,7 @@ Polymer({
/**
* Current step displayed.
* @type {DialogMode}
* @private
*/
step_: {
......@@ -1591,10 +1593,15 @@ Polymer({
},
/**
* Simple equality comparison function.
* Checks if current step is one of specified steps.
* @param {DialogMode} currentStep Name of current step.
* @param {...string} stepsVarArgs List of steps to compare with.
* @return {boolean}
*/
eq_: function(currentStep, expectedStep) {
return currentStep == expectedStep;
isStep_: function(currentStep, ...stepsVarArgs) {
if (stepsVarArgs.length < 1)
throw Error('At least one step to compare is required.');
return stepsVarArgs.some(step => currentStep === step);
},
/**
......@@ -1610,7 +1617,11 @@ Polymer({
return;
}
if (isLoading) {
if (mode == AuthMode.DEFAULT) {
this.step_ = DialogMode.GAIA_LOADING;
} else {
this.step_ = DialogMode.LOADING;
}
return;
}
if (isWhitelistError) {
......
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