Skip to content

Commit

Permalink
Clean up "newOobeLayoutEnabled" from EDU Coexistence flow
Browse files Browse the repository at this point in the history
This flag is always true.

Tested: Tested all coexistence screens to check that the buttons are
appearing with rounded corners and that the layout has not changed.

Bug: b:297087172
Change-Id: I96f8526f63a547b9c922884ee293c6f31cf0a28b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4803153
Reviewed-by: Aga Wronska <agawronska@chromium.org>
Commit-Queue: Courtney Wong <courtneywong@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1187362}
  • Loading branch information
Courtney Wong authored and Chromium LUCI CQ committed Aug 23, 2023
1 parent ab3c524 commit b93541e
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 115 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

<style>
.no-border {
cr-button {
border: 0;
}

.button-radius {
border-radius: 20px;
}
</style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class EduCoexistenceButton extends EduCoexistenceButtonBase {
*/
buttonClasses: {
type: String,
computed: 'getClass_(buttonType, newOobeStyleEnabled)',
computed: 'getClass_(buttonType)',
},

/**
Expand Down Expand Up @@ -89,21 +89,12 @@ class EduCoexistenceButton extends EduCoexistenceButtonBase {

/**
* @param {!ButtonTypes} buttonType
* @param {boolean} newOobeStyleEnabled
* @return {string} CSS class names
* @private
*/
getClass_(buttonType, newOobeStyleEnabled) {
getClass_(buttonType) {
this.assertButtonType_(buttonType);

// Disable the border if necessary.
const cssClassses = newOobeStyleEnabled ? 'no-border button-radius' : '';

if (buttonType === ButtonTypes.BACK) {
return cssClassses;
}

return 'action-button ' + cssClassses;
return buttonType === ButtonTypes.ACTION ? 'action-button' : '';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const MILLISECONDS_PER_SECOND = 1000;
* email: (string|undefined),
* readOnlyEmail: (string|undefined),
* signinTime: (number),
* newOobeLayoutEnabled: (boolean),
* }}
*/
export let EduCoexistenceParams;
Expand Down Expand Up @@ -72,7 +71,6 @@ export class EduCoexistenceController extends PostMessageApiServer {
super(webview, originURLPrefix, originURLPrefix);

this.ui = ui;
this.newOobeLayoutEnabled_ = params.newOobeLayoutEnabled;
this.isOobe_ = params.sourceUi === 'oobe';
this.flowURL_ = flowURL;
this.originURLPrefix_ = originURLPrefix;
Expand Down Expand Up @@ -132,11 +130,6 @@ export class EduCoexistenceController extends PostMessageApiServer {
['Error initializing communication channel with origin:' + origin]);
}

/** @return {boolean} */
getNewOobeLayoutEnabled() {
return this.newOobeLayoutEnabled_;
}

/** @return {boolean} */
getIsOobe() {
return this.isOobe_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@
width: 100%;
}

/* Used to spread out the buttons in the old-style OOBE layout
* which has 2 buttons at the bottom of the page.
*/
.buttons-layout {
justify-content: space-between;
}

.new-oobe-layout-back-button {
.back-button {
padding: 22px 0 0 22px;
}

Expand All @@ -66,8 +59,7 @@
flex-direction: row;
}

/* Layout for the new OOBE buttons is adaptive */
.new-oobe-buttons-layout {
.buttons-layout {
align-items: center;
display: flex;
justify-content: flex-end;
Expand Down Expand Up @@ -103,8 +95,7 @@
flex-direction: column;
}

/* Layout for the new OOBE buttons is adaptive */
.new-oobe-buttons-layout {
.buttons-layout {
display: flex;
justify-content: center;
width: 100%;
Expand Down Expand Up @@ -224,16 +215,6 @@
border-radius: 50%;
flex-shrink: 0;
}

.buttons-layout {
align-items: center;
display: flex;
justify-content: space-between;
margin-inline-end: 32px;
margin-inline-start: 32px;
width: 100%;
}

span[slot='buttons'] {
display: flex;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
</span>
<span slot="buttons">
<div class="footer">
<div class="new-oobe-buttons-layout">
<span>
<edu-coexistence-button button-type="action">
</edu-coexistence-button>
</span>
<div class="buttons-layout">
<edu-coexistence-button button-type="action"></edu-coexistence-button>
</div>
</div>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class EduCoexistenceError extends PolymerElement {
/** @override */
ready() {
super.ready();
this.shadowRoot.querySelector('edu-coexistence-button')
.newOobeStyleEnabled = true;
this.shadowRoot.querySelector('edu-coexistence-template')
.showButtonFooter(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
<supervised-user-offline></supervised-user-offline>
</div>
<div slot="buttons" class="footer">
<div class="new-oobe-buttons-layout">
<span>
<edu-coexistence-button button-type="action">
</edu-coexistence-button>
</span>
<div class="buttons-layout">
<edu-coexistence-button button-type="action"></edu-coexistence-button>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class EduCoexistenceOffline extends PolymerElement {
/** @override */
ready() {
super.ready();
this.shadowRoot.querySelector('edu-coexistence-button')
.newOobeStyleEnabled = true;
this.shadowRoot.querySelector('edu-coexistence-template')
.showButtonFooter(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@

<edu-coexistence-template>
<span slot="main">
<div class="new-oobe-layout-back-button" hidden$="[[!showGaiaButtons_]]">
<edu-coexistence-button hidden$="[[!newOobeLayoutEnabled_]]"
button-type="back"
<div class="back-button" hidden$="[[!showGaiaButtons_]]">
<edu-coexistence-button button-type="back"
id="gaia-back-button"
on-go-back="handleGaiaLoginGoBack_">
</edu-coexistence-button>
Expand All @@ -42,20 +41,11 @@
</div>
</div>
</span>
<span slot="buttons" hidden$="[[!showGaiaButtons_]]"
class$="[[buttonsLayoutCssClass_]]">
<span hidden$="[[newOobeLayoutEnabled_]]">
<edu-coexistence-button button-type="back"
id="gaia-back-button"
on-go-back="handleGaiaLoginGoBack_">
</edu-coexistence-button>
</span>
<span>
<gaia-action-buttons id="gaiaNextButton"
authenticator="[[controller_.authExtHost_]]"
rounded-button="[[newOobeLayoutEnabled_]]"
hidden$="[[!showGaiaNextButton_]]">
</gaia-action-buttons>
</span>
<span slot="buttons" hidden$="[[!showGaiaButtons_]]" class="buttons-layout">
<gaia-action-buttons id="gaiaNextButton"
authenticator="[[controller_.authExtHost_]]"
rounded-button="true"
hidden$="[[!showGaiaNextButton_]]">
</gaia-action-buttons>
</span>
</edu-coexistence-template>
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,6 @@ class EduCoexistenceUi extends EduCoexistenceUiBase {
value: false,
},

/**
* Indicates whether the new OOBE Layout should be enabled. For
* simplicity, this only controls whether particular elements are
* rendered, and does not prevent the new oobe adaptive layout features,
* which will always be enabled.
* @private
*/
newOobeLayoutEnabled_: {
type: Boolean,
value: false,
},

/**
* Indicates the CSS class used for the buttons-layout for
* the buttons at the bottom of the screen. The layout
* differs depending on whether the new OOBE layout is enabled.
* @private
*/
buttonsLayoutCssClass_: {
type: String,
computed: 'getButtonsCssClass_(newOobeLayoutEnabled_)',
},

/**
* The EDU Coexistence controller instance.
* @private
Expand Down Expand Up @@ -116,8 +93,6 @@ class EduCoexistenceUi extends EduCoexistenceUiBase {
(data) => {
this.controller_ =
new EduCoexistenceController(this, assert(this.webview_), data);
this.newOobeLayoutEnabled_ =
this.controller_.getNewOobeLayoutEnabled();
EduCoexistenceBrowserProxyImpl.getInstance().initializeLogin();
},
(err) => {
Expand Down Expand Up @@ -176,11 +151,6 @@ class EduCoexistenceUi extends EduCoexistenceUiBase {
});
}

/** @private */
getButtonsCssClass_(newOobeLayoutEnabled) {
return newOobeLayoutEnabled ? 'new-oobe-buttons-layout' : 'buttons-layout';
}

/**
* Configures the UI for showing/hiding the GAIA login flow.
* @private
Expand All @@ -191,12 +161,6 @@ class EduCoexistenceUi extends EduCoexistenceUiBase {
const contentContainer = template.$$('div.content-container');

if (currentUrl.hostname !== this.controller_.getFlowOriginHostname()) {
this.shadowRoot.querySelector('edu-coexistence-button')
.newOobeStyleEnabled = this.newOobeLayoutEnabled_;

this.shadowRoot.querySelector('gaia-action-buttons').roundedButton =
this.newOobeLayoutEnabled_;

// Show the GAIA Buttons.
this.showGaiaButtons_ = true;
// Shrink the content-container so that the buttons line up more closely
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ void EduCoexistenceLoginHandler::SendInitializeEduArgs() {
params.Set("deviceId", GetDeviceIdForActiveUserProfile());

params.Set("signinTime", GetSigninTime().ToJsTimeIgnoringNull());
// TODO(crbug.com/1202135): Remove along with JS part.
params.Set("newOobeLayoutEnabled", true);

// If the secondary edu account is being reauthenticated, the email address
// will be provided via the url of the webcontent. Example
Expand Down

0 comments on commit b93541e

Please sign in to comment.