-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ProfilePicker]: Show profile list in the profile picker.
Screenshot: https://drive.google.com/file/d/18bGaUJgUnLlOepkFNhcaL1dfCJGOnHMw/view?usp=sharing Bug: 1063856 Change-Id: I85c2ed37f84b941a052af604623db44615832a00 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277810 Commit-Queue: Monica Basta <msalama@chromium.org> Reviewed-by: Esmael Elmoslimany <aee@chromium.org> Cr-Commit-Position: refs/heads/master@{#785671}
- Loading branch information
Monica Basta
authored and
Commit Bot
committed
Jul 7, 2020
1 parent
ad2a73a
commit ab3c521
Showing
8 changed files
with
169 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
chrome/browser/resources/signin/profile_picker/profile_card.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<style> | ||
cr-button { | ||
--text-color: inherit; | ||
background-color: rgb(248, 249, 250); | ||
border: none; | ||
border-radius: inherit; | ||
box-shadow: none; | ||
flex-direction: column; | ||
height: inherit; | ||
padding: 0; | ||
width: inherit; | ||
} | ||
|
||
:host-context(.focus-outline-visible) cr-button:focus { | ||
box-shadow: 0 0 0 2px rgba(var(--google-blue-600-rgb), .4); | ||
} | ||
|
||
.profile-avatar { | ||
border-radius: 37px; | ||
height: var(--avatar-icon-size); | ||
width: var(--avatar-icon-size); | ||
} | ||
|
||
.profile-info { | ||
height: 20px; | ||
overflow: hidden; | ||
padding: 16px; | ||
text-align: center; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
width: 146px; | ||
} | ||
</style> | ||
|
||
<cr-button on-click="onProfileClick_"> | ||
<!-- TODO(msalama): Implement editing local profile name in place --> | ||
<div class="profile-info">[[profileState.localProfileName]]</div> | ||
<img class="profile-avatar" alt="" src="[[profileState.avatarIcon]]"> | ||
<div class="profile-info">[[profileState.gaiaName]]</div> | ||
</cr-button> |
37 changes: 37 additions & 0 deletions
37
chrome/browser/resources/signin/profile_picker/profile_card.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2020 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. | ||
|
||
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js'; | ||
|
||
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
import {ManageProfilesBrowserProxy, ManageProfilesBrowserProxyImpl, ProfileState} from './manage_profiles_browser_proxy.js'; | ||
|
||
Polymer({ | ||
is: 'profile-card', | ||
|
||
_template: html`{__html_template__}`, | ||
|
||
properties: { | ||
/** @type {!ProfileState} */ | ||
profileState: { | ||
type: Object, | ||
} | ||
}, | ||
|
||
/** @private {ManageProfilesBrowserProxy} */ | ||
manageProfilesBrowserProxy_: null, | ||
|
||
/** @override */ | ||
ready() { | ||
this.manageProfilesBrowserProxy_ = | ||
ManageProfilesBrowserProxyImpl.getInstance(); | ||
}, | ||
|
||
/** @private */ | ||
onProfileClick_() { | ||
this.manageProfilesBrowserProxy_.openSelectedProfile( | ||
this.profileState.profilePath); | ||
}, | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters