Commit 63d5cf28 authored by David Roger's avatar David Roger Committed by Commit Bot

[signin] Remove one of the avatars from the signin interception bubble

The bubble is being simplified. This CL removes one of the avatars, and
a follow-up will update the text.

Screenshots with various combinations of colors and modes:
https://screenshot.googleplex.com/b7edab3a-fbb3-482f-9c50-9e4704d20cc8.png
https://screenshot.googleplex.com/af86cce2-0b4f-40d2-b521-4584883249a6.png
https://screenshot.googleplex.com/f818aa03-62aa-4325-baef-d0ba3589c034.png
https://screenshot.googleplex.com/9dace8af-7e2f-4b79-84a2-10207270509b.png


Bug: 1076880
Change-Id: Ic36c42368d9820358fdb3b323b7e7dfd04fbef49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362929Reviewed-by: default avatarMonica Basta <msalama@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799631}
parent e6478ca4
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
} }
#header { #header {
--avatar-position: 84px;
background-color: var(--header-background-color); background-color: var(--header-background-color);
border-radius: 4px; border-radius: 4px;
color: var(--header-text-color); color: var(--header-text-color);
...@@ -26,18 +25,17 @@ ...@@ -26,18 +25,17 @@
white-space: nowrap; white-space: nowrap;
} }
.avatar-container { #avatar-container {
--avatar-image-width: 60px; --avatar-image-width: 60px;
--avatar-border: 2px; --avatar-border: 2px;
--avatar-size: calc(var(--avatar-image-width) + 2 * var(--avatar-border)); --avatar-size: calc(var(--avatar-image-width) + 2 * var(--avatar-border));
--avatar-radius: calc(var(--avatar-image-width)/2 + var(--avatar-border));
--avatar-overlap: 27px;
height: var(--avatar-size); height: var(--avatar-size);
left: calc(50% - var(--avatar-size)/2);
position: absolute; position: absolute;
width: var(--avatar-size); width: var(--avatar-size);
} }
.avatar { #avatar {
/** The user avatar may be transparent, add a background */ /** The user avatar may be transparent, add a background */
background-color: var(--md-background-color); background-color: var(--md-background-color);
border: var(--avatar-border) solid var(--md-background-color); border: var(--avatar-border) solid var(--md-background-color);
...@@ -73,16 +71,6 @@ ...@@ -73,16 +71,6 @@
width: var(--work-icon-size); width: var(--work-icon-size);
} }
#interceptedAvatar {
left: calc(50% - var(--avatar-radius) - var(--avatar-overlap));
/** Ensure the intercepted avatar is on top of the primary avatar */
z-index: 1;
}
#primaryAvatar {
left: calc(50% - var(--avatar-radius) + var(--avatar-overlap));
}
#body { #body {
color: var(--cr-secondary-text-color); color: var(--cr-secondary-text-color);
flex-grow: 1; flex-grow: 1;
...@@ -110,22 +98,14 @@ ...@@ -110,22 +98,14 @@
<div id="header"> <div id="header">
<div id="headerText">[[interceptionParameters_.headerText]]</div> <div id="headerText">[[interceptionParameters_.headerText]]</div>
<div class="avatar-container" id="interceptedAvatar"> <div id="avatar-container">
<img class="avatar" id="interceptedAvatarImg" <img id="avatar"
src="[[interceptionParameters_.interceptedAccount.pictureUrl]]"> src="[[interceptionParameters_.interceptedAccount.pictureUrl]]">
<div class="work-badge" id="interceptedBadge" <div class="work-badge" id="badge"
hidden="[[!interceptionParameters_.interceptedAccount.isManaged]]"> hidden="[[!interceptionParameters_.interceptedAccount.isManaged]]">
<iron-icon class="icon" icon="signin:business"></iron-icon> <iron-icon class="icon" icon="signin:business"></iron-icon>
</div> </div>
</div> </div>
<div class="avatar-container" id="primaryAvatar">
<img class="avatar" id="primaryAvatarImg"
src="[[interceptionParameters_.primaryAccount.pictureUrl]]">
<div class="work-badge" id="primaryBadge"
hidden="[[!interceptionParameters_.primaryAccount.isManaged]]">
<iron-icon class="icon" icon="signin:business"></iron-icon>
</div>
</div>
</div> </div>
<div id="body"> <div id="body">
......
...@@ -71,6 +71,5 @@ Polymer({ ...@@ -71,6 +71,5 @@ Polymer({
handleParametersChanged_(parameters) { handleParametersChanged_(parameters) {
this.interceptionParameters_ = parameters; this.interceptionParameters_ = parameters;
this.notifyPath('interceptionParameters_.interceptedAccount.isManaged'); this.notifyPath('interceptionParameters_.interceptedAccount.isManaged');
this.notifyPath('interceptionParameters_.primaryAccount.isManaged');
}, },
}); });
...@@ -23,7 +23,6 @@ export let AccountInfo; ...@@ -23,7 +23,6 @@ export let AccountInfo;
* bodyTitle: string, * bodyTitle: string,
* bodyText: string, * bodyText: string,
* interceptedAccount: AccountInfo, * interceptedAccount: AccountInfo,
* primaryAccount: AccountInfo,
* }} * }}
*/ */
export let InterceptionParameters; export let InterceptionParameters;
......
...@@ -158,7 +158,6 @@ base::Value DiceWebSigninInterceptHandler::GetInterceptionParametersValue() { ...@@ -158,7 +158,6 @@ base::Value DiceWebSigninInterceptHandler::GetInterceptionParametersValue() {
parameters.SetStringKey("bodyText", GetBodyText()); parameters.SetStringKey("bodyText", GetBodyText());
parameters.SetKey("interceptedAccount", parameters.SetKey("interceptedAccount",
GetAccountInfoValue(intercepted_account())); GetAccountInfoValue(intercepted_account()));
parameters.SetKey("primaryAccount", GetAccountInfoValue(primary_account()));
return parameters; return parameters;
} }
......
...@@ -28,10 +28,6 @@ suite('DiceWebSigninInterceptTest', function() { ...@@ -28,10 +28,6 @@ suite('DiceWebSigninInterceptTest', function() {
const AVATAR_URL_1 = 'chrome://theme/IDR_PROFILE_AVATAR_1'; const AVATAR_URL_1 = 'chrome://theme/IDR_PROFILE_AVATAR_1';
/** @type {string} */ /** @type {string} */
const AVATAR_URL_2 = 'chrome://theme/IDR_PROFILE_AVATAR_2'; const AVATAR_URL_2 = 'chrome://theme/IDR_PROFILE_AVATAR_2';
/** @type {string} */
const AVATAR_URL_3 = 'chrome://theme/IDR_PROFILE_AVATAR_3';
/** @type {string} */
const AVATAR_URL_4 = 'chrome://theme/IDR_PROFILE_AVATAR_4';
setup(function() { setup(function() {
browserProxy = new TestDiceWebSigninInterceptBrowserProxy(); browserProxy = new TestDiceWebSigninInterceptBrowserProxy();
...@@ -94,43 +90,33 @@ suite('DiceWebSigninInterceptTest', function() { ...@@ -94,43 +90,33 @@ suite('DiceWebSigninInterceptTest', function() {
bodyTitle: 'new_body_title', bodyTitle: 'new_body_title',
bodyText: 'new_body_text', bodyText: 'new_body_text',
interceptedAccount: {isManaged: false, pictureUrl: AVATAR_URL_1}, interceptedAccount: {isManaged: false, pictureUrl: AVATAR_URL_1},
primaryAccount: {isManaged: false, pictureUrl: AVATAR_URL_2}
}); });
checkTextValues('new_header_text', 'new_body_title', 'new_body_text'); checkTextValues('new_header_text', 'new_body_title', 'new_body_text');
}); });
test('Avatars', function() { test('Avatars', function() {
// Consumer avatars. // Consumer avatars.
checkImageUrl('#interceptedAvatarImg', AVATAR_URL_1); checkImageUrl('#avatar', AVATAR_URL_1);
checkImageUrl('#primaryAvatarImg', AVATAR_URL_2); assertFalse(isChildVisible(app, '#badge'));
assertFalse(isChildVisible(app, '#interceptedBadge'));
assertFalse(isChildVisible(app, '#primaryBadge'));
const parameters = { const parameters = {
headerText: 'header_text', headerText: 'header_text',
bodyTitle: 'body_title', bodyTitle: 'body_title',
bodyText: 'body_text', bodyText: 'body_text',
interceptedAccount: {isManaged: false, pictureUrl: AVATAR_URL_3}, interceptedAccount: {isManaged: false, pictureUrl: AVATAR_URL_2},
primaryAccount: {isManaged: false, pictureUrl: AVATAR_URL_4}
}; };
// Update urls. // Update urls.
fireParametersChanged(parameters); fireParametersChanged(parameters);
checkImageUrl('#interceptedAvatarImg', AVATAR_URL_3); checkImageUrl('#avatar', AVATAR_URL_2);
checkImageUrl('#primaryAvatarImg', AVATAR_URL_4);
// Update isManaged for intercepted account. // Update isManaged for intercepted account.
parameters.interceptedAccount.isManaged = true; parameters.interceptedAccount.isManaged = true;
fireParametersChanged(parameters); fireParametersChanged(parameters);
assertTrue(isChildVisible(app, '#interceptedBadge')); assertTrue(isChildVisible(app, '#badge'));
assertFalse(isChildVisible(app, '#primaryBadge'));
// Update isManaged for primary account.
parameters.interceptedAccount.isManaged = false; parameters.interceptedAccount.isManaged = false;
parameters.primaryAccount.isManaged = true;
fireParametersChanged(parameters); fireParametersChanged(parameters);
assertFalse(isChildVisible(app, '#interceptedBadge')); assertFalse(isChildVisible(app, '#badge'));
assertTrue(isChildVisible(app, '#primaryBadge'));
}); });
}); });
...@@ -16,7 +16,6 @@ export class TestDiceWebSigninInterceptBrowserProxy extends TestBrowserProxy { ...@@ -16,7 +16,6 @@ export class TestDiceWebSigninInterceptBrowserProxy extends TestBrowserProxy {
bodyTitle: '', bodyTitle: '',
bodyText: '', bodyText: '',
interceptedAccount: {isManaged: false, pictureUrl: ''}, interceptedAccount: {isManaged: false, pictureUrl: ''},
primaryAccount: {isManaged: false, pictureUrl: ''}
}; };
} }
......
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