Commit d3e267c3 authored by Danila Kuzmin's avatar Danila Kuzmin Committed by Chromium LUCI CQ

oobe: Migrate supervision-transition-element to MultiStepBehavior

Bug: 1159430
Change-Id: I9923cc0a1590a26a2fa9988a6bbd5220d40fa9e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2604911
Commit-Queue: Danila Kuzmin <dkuzmin@google.com>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839586}
parent bafb6e40
/* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
paper-progress {
--paper-progress-active-color: rgb(66, 133, 244);
--paper-progress-container-color: rgb(206, 224, 252);
--paper-progress-secondary-color: rgb(66, 133, 244);
display: block;
height: 3px;
padding: 40px 0 0 0;
width: 100%;
}
.supervision-icon {
--iron-icon-height: 32px;
--iron-icon-width: 32px;
}
...@@ -9,11 +9,25 @@ ...@@ -9,11 +9,25 @@
<dom-module id="supervision-transition-element"> <dom-module id="supervision-transition-element">
<template> <template>
<style include="oobe-dialog-host"></style> <style include="oobe-dialog-host">
<link rel="stylesheet" href="oobe_supervision_transition.css"> paper-progress {
--paper-progress-active-color: rgb(66, 133, 244); /*#4285F4*/
--paper-progress-container-color: rgb(206, 224, 252); /*#CEE0FC*/
--paper-progress-secondary-color: rgb(66, 133, 244); /*#4285F4*/
display: block;
height: 3px;
padding: 40px 0 0 0;
width: 100%;
}
.supervision-icon {
--iron-icon-height: 32px;
--iron-icon-width: 32px;
}
</style>
<oobe-dialog id="supervisionTransitionDialog" role="alert" <oobe-dialog id="supervisionTransitionDialog" role="alert"
aria-label$="[[getDialogA11yTitle_(locale, isRemovingSupervision_)]]" aria-label$="[[getDialogA11yTitle_(locale, isRemovingSupervision_)]]"
subtitle-key="supervisionTransitionIntroMessage"> subtitle-key="supervisionTransitionIntroMessage" for-step="progress">
<iron-icon src="chrome://oobe/supervision_icon.png" slot="oobe-icon" <iron-icon src="chrome://oobe/supervision_icon.png" slot="oobe-icon"
class="supervision-icon" aria-hidden="true"> class="supervision-icon" aria-hidden="true">
</iron-icon> </iron-icon>
...@@ -34,13 +48,15 @@ ...@@ -34,13 +48,15 @@
title-key="supervisionTransitionErrorTitle" title-key="supervisionTransitionErrorTitle"
subtitle-key="supervisionTransitionErrorMessage" subtitle-key="supervisionTransitionErrorMessage"
aria-label$="[[i18nDynamic(locale,'supervisionTransitionErrorTitle')]]" aria-label$="[[i18nDynamic(locale,'supervisionTransitionErrorTitle')]]"
has-buttons hidden> has-buttons for-step="error">
<iron-icon src="chrome://oobe/supervision_icon.png" slot="oobe-icon" <iron-icon src="chrome://oobe/supervision_icon.png" slot="oobe-icon"
aria-hidden="true"> aria-hidden="true">
</iron-icon> </iron-icon>
<div slot="bottom-buttons" class="layout horizontal end-justified"> <div slot="bottom-buttons" class="layout horizontal end-justified">
<oobe-text-button id="accept-button" on-click="onAcceptAndContinue_" <oobe-text-button id="accept-button" on-click="onAcceptAndContinue_"
text-key="supervisionTransitionButton" inverse></oobe-text-button> text-key="supervisionTransitionButton" class="focus-on-show"
inverse>
</oobe-text-button>
</div> </div>
</oobe-dialog> </oobe-dialog>
</template> </template>
......
...@@ -7,10 +7,17 @@ ...@@ -7,10 +7,17 @@
* transition screen. * transition screen.
*/ */
(function() {
const UIState = {
PROGRESS: 'progress',
ERROR: 'error',
};
Polymer({ Polymer({
is: 'supervision-transition-element', is: 'supervision-transition-element',
behaviors: [OobeI18nBehavior, OobeDialogHostBehavior, LoginScreenBehavior], behaviors: [OobeI18nBehavior, LoginScreenBehavior, MultiStepBehavior],
properties: { properties: {
/** /**
...@@ -19,6 +26,12 @@ Polymer({ ...@@ -19,6 +26,12 @@ Polymer({
isRemovingSupervision_: Boolean, isRemovingSupervision_: Boolean,
}, },
UI_STEPS: UIState,
defaultUIStep() {
return UIState.PROGRESS;
},
ready() { ready() {
this.initializeLoginScreen('SupervisionTransitionScreen', { this.initializeLoginScreen('SupervisionTransitionScreen', {
resetAllowed: false, resetAllowed: false,
...@@ -48,10 +61,7 @@ Polymer({ ...@@ -48,10 +61,7 @@ Polymer({
/** @private */ /** @private */
showSupervisionTransitionFailedScreen_() { showSupervisionTransitionFailedScreen_() {
this.$.supervisionTransitionDialog.hidden = true; this.setUIStep(UIState.ERROR);
this.$.supervisionTransitionErrorDialog.hidden = false;
this.$.supervisionTransitionErrorDialog.show();
this.$.supervisionTransitionErrorDialog.focus();
}, },
/** /**
...@@ -63,3 +73,4 @@ Polymer({ ...@@ -63,3 +73,4 @@ Polymer({
chrome.send('finishSupervisionTransition'); chrome.send('finishSupervisionTransition');
}, },
}); });
})();
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