Commit 405a6639 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

[oobe] make sure that onBeforeShow is called for all oobe dialogs

Bug: 955194
Change-Id: Ibb4b828b439d04166e1a00cc423bc525811ed4c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117734Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753646}
parent 167a0f68
...@@ -99,13 +99,6 @@ Polymer({ ...@@ -99,13 +99,6 @@ Polymer({
}, },
}, },
onBeforeShow() {
this.behaviors.forEach((behavior) => {
if (behavior.onBeforeShow)
behavior.onBeforeShow.call(this);
});
},
computeProgressMessage_( computeProgressMessage_(
hasEstimate, defaultProgressMessage, estimatedTimeLeftMsg_) { hasEstimate, defaultProgressMessage, estimatedTimeLeftMsg_) {
if (hasEstimate) if (hasEstimate)
......
...@@ -138,6 +138,7 @@ function initializeDiscoverAPI() { ...@@ -138,6 +138,7 @@ function initializeDiscoverAPI() {
} }
if (module) { if (module) {
this.hideAll_(); this.hideAll_();
module.onBeforeShow();
module.hidden = false; module.hidden = false;
module.show(); module.show();
} else { } else {
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
<link rel="stylesheet" href="oobe_dialog_host.css"> <link rel="stylesheet" href="oobe_dialog_host.css">
<link rel="stylesheet" href="gaia_card_parameters.css"> <link rel="stylesheet" href="gaia_card_parameters.css">
<oobe-dialog role="dialog" has-buttons selected$="[[activeSection]]" <oobe-dialog role="dialog" has-buttons selected$="[[activeSection]]"
animation-in-progress$="[[animationInProgress]]" no-header id="dialog" no-header no-footer-padding
no-footer-padding> animation-in-progress$="[[animationInProgress]]">
<div slot="footer"> <div slot="footer">
<img id="icon" src="chrome://theme/IDR_LOGO_GOOGLE_COLOR_90" alt=""> <img id="icon" src="chrome://theme/IDR_LOGO_GOOGLE_COLOR_90" alt="">
</div> </div>
......
...@@ -50,6 +50,14 @@ ...@@ -50,6 +50,14 @@
this.switchToEmailCard(true /* animated */); this.switchToEmailCard(true /* animated */);
}, },
onBeforeShow() {
this.behaviors.forEach((behavior) => {
if (behavior.onBeforeShow)
behavior.onBeforeShow.call(this);
});
this.$$('#dialog').onBeforeShow();
},
onForgotPasswordClicked_() { onForgotPasswordClicked_() {
this.disabled = true; this.disabled = true;
this.fire('dialogShown'); this.fire('dialogShown');
......
...@@ -49,6 +49,10 @@ Polymer({ ...@@ -49,6 +49,10 @@ Polymer({
}, },
onBeforeShow(data) { onBeforeShow(data) {
this.behaviors.forEach((behavior) => {
if (behavior.onBeforeShow)
behavior.onBeforeShow.call(this);
});
this.setScreenState(this.SCREEN_STATE_SETUP); this.setScreenState(this.SCREEN_STATE_SETUP);
}, },
......
...@@ -65,14 +65,6 @@ Polymer({ ...@@ -65,14 +65,6 @@ Polymer({
this.$.termsOfServiceDialog.show(); this.$.termsOfServiceDialog.show();
}, },
/** Called when dialog is shown */
onBeforeShow() {
this.behaviors.forEach((behavior) => {
if (behavior.onBeforeShow)
behavior.onBeforeShow.call(this);
});
},
/** /**
* This is called when strings are updated. * This is called when strings are updated.
* @override * @override
......
...@@ -40,6 +40,14 @@ login.createScreen( ...@@ -40,6 +40,14 @@ login.createScreen(
}); });
}, },
/**
* Returns default event target element.
* @type {Object}
*/
get defaultControl() {
return this.adPasswordChanged_;
},
/** /**
* Cancels password changing and drops the user back to the login * Cancels password changing and drops the user back to the login
* screen. * screen.
......
...@@ -256,6 +256,7 @@ login.createScreen('ErrorMessageScreen', 'error-message', function() { ...@@ -256,6 +256,7 @@ login.createScreen('ErrorMessageScreen', 'error-message', function() {
*/ */
onBeforeShow(data) { onBeforeShow(data) {
cr.ui.Oobe.clearErrors(); cr.ui.Oobe.clearErrors();
$('error-message-md').onBeforeShow();
$('error-message-back-button').disabled = !this.closable; $('error-message-back-button').disabled = !this.closable;
}, },
......
...@@ -714,6 +714,7 @@ Polymer({ ...@@ -714,6 +714,7 @@ Polymer({
this.$['offline-ad-auth'].onBeforeShow(); this.$['offline-ad-auth'].onBeforeShow();
this.$['signin-frame-dialog'].onBeforeShow(); this.$['signin-frame-dialog'].onBeforeShow();
this.$['offline-gaia'].onBeforeShow();
this.$.pinDialog.onBeforeShow(); this.$.pinDialog.onBeforeShow();
}, },
......
...@@ -27,6 +27,14 @@ login.createScreen('PasswordChangedScreen', 'password-changed', function() { ...@@ -27,6 +27,14 @@ login.createScreen('PasswordChangedScreen', 'password-changed', function() {
}); });
}, },
/**
* Returns default event target element.
* @type {Object}
*/
get defaultControl() {
return this.gaiaPasswordChanged_;
},
/** /**
* Cancels password migration and drops the user back to the login screen. * Cancels password migration and drops the user back to the login screen.
*/ */
......
...@@ -23,6 +23,15 @@ login.createScreen('RecommendAppsScreen', 'recommend-apps', function() { ...@@ -23,6 +23,15 @@ login.createScreen('RecommendAppsScreen', 'recommend-apps', function() {
return $('recommend-apps-screen'); return $('recommend-apps-screen');
}, },
/**
* Event handler that is invoked just before the screen is shown.
* @param {Object} data Screen init payload.
*/
onBeforeShow(data) {
$('recommend-apps-loading').onBeforeShow();
$('recommend-apps-screen').onBeforeShow();
},
/* /*
* Executed on language change. * Executed on language change.
*/ */
......
...@@ -22,6 +22,15 @@ login.createScreen('SyncConsentScreen', 'sync-consent', function() { ...@@ -22,6 +22,15 @@ login.createScreen('SyncConsentScreen', 'sync-consent', function() {
return OOBE_UI_STATE.ONBOARDING; return OOBE_UI_STATE.ONBOARDING;
}, },
/**
* Event handler that is invoked just before the screen is shown.
* @param {Object} data Screen init payload.
*/
onBeforeShow(data) {
$('sync-loading').onBeforeShow();
$('sync-consent-impl').onBeforeShow();
},
/** /**
* Event handler that is invoked just before the screen is hidden. * Event handler that is invoked just before the screen is hidden.
*/ */
......
...@@ -17,6 +17,14 @@ login.createScreen('TPMErrorMessageScreen', 'tpm-error-message', function() { ...@@ -17,6 +17,14 @@ login.createScreen('TPMErrorMessageScreen', 'tpm-error-message', function() {
}); });
}, },
/**
* Returns default event target element.
* @type {Object}
*/
get defaultControl() {
return $('tpm-error-dialog');
},
/** /**
* Show TPM screen. * Show TPM screen.
*/ */
......
...@@ -39,6 +39,14 @@ login.createScreen('UpdateRequiredScreen', 'update-required', function() { ...@@ -39,6 +39,14 @@ login.createScreen('UpdateRequiredScreen', 'update-required', function() {
return OOBE_UI_STATE.BLOCKING; return OOBE_UI_STATE.BLOCKING;
}, },
/**
* Returns default event target element.
* @type {Object}
*/
get defaultControl() {
return $('update-required-card');
},
/** @param {string} domain Enterprise domain name */ /** @param {string} domain Enterprise domain name */
/** @param {string} device Device name */ /** @param {string} device Device name */
setEnterpriseAndDeviceName(enterpriseDomain, device) { setEnterpriseAndDeviceName(enterpriseDomain, device) {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<link rel="stylesheet" href="security_token_pin.css"> <link rel="stylesheet" href="security_token_pin.css">
<oobe-dialog class="gaia-dialog" has-buttons role="dialog" <oobe-dialog class="gaia-dialog" has-buttons role="dialog"
title-key="securityTokenPinDialogTitle" title-key="securityTokenPinDialogTitle" id="dialog"
aria-label$="[[i18nDynamic(locale, 'securityTokenPinDialogTitle')]]" aria-label$="[[i18nDynamic(locale, 'securityTokenPinDialogTitle')]]"
aria-describedby="description"> aria-describedby="description">
<hd-iron-icon slot="oobe-icon" icon1x="oobe-32:lock" <hd-iron-icon slot="oobe-icon" icon1x="oobe-32:lock"
......
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