Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Password Manager] Displaying PasswordUiEntry
This change allows to display individual PasswordUiEntry in the password details section. None of the buttons work yet. Notes aren't supported as well. Impl: https://screenshot.googleplex.com/7oQ8oWEvWhtRhsN Mock: https://screenshot.googleplex.com/74qPwqnR6VQXUiW Note: username, password and note fields background color looks darker compared to mocks, but the UX designer was okay with it since this is the default color for input fields. Bug: 1350947 Change-Id: Iab6f0f2f620f45cce0b489849519bf29fe2d4fef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4026045 Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com> Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org> Reviewed-by: John Lee <johntlee@chromium.org> Cr-Commit-Position: refs/heads/main@{#1078052}
- Loading branch information
Viktor Semeniuk
authored and
Chromium LUCI CQ
committed
Dec 1, 2022
1 parent
d46a7fc
commit 6ace9ed
Showing
23 changed files
with
339 additions
and
20 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
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_COPY_PASSWORD.png.sha1
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 @@ | ||
d486fd43a668c183c27ce625b0d86b1fdd22e21b |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_COPY_USERNAME.png.sha1
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 @@ | ||
2ca62e78b57cb4cd435e4c4b6d9c4ca8ddcfbdba |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_HIDE_PASSWORD.png.sha1
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 @@ | ||
c8946628b903696d52c48c4c820f8a5cf9fd3256 |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_NOTES_LABEL.png.sha1
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 @@ | ||
2d957ab6bdbaafe89daa0ea6ceddebb71179267e |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_NO_NOTE_SAVED.png.sha1
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 @@ | ||
2d957ab6bdbaafe89daa0ea6ceddebb71179267e |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_PASSWORD_LABEL.png.sha1
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 @@ | ||
2d957ab6bdbaafe89daa0ea6ceddebb71179267e |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SHOW_PASSWORD.png.sha1
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 @@ | ||
0e0716bb5967138076f88a03234b0a683a9126e7 |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_SITES_LABEL.png.sha1
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 @@ | ||
2d957ab6bdbaafe89daa0ea6ceddebb71179267e |
1 change: 1 addition & 0 deletions
1
chrome/app/password_manager_ui_strings_grdp/IDS_PASSWORD_MANAGER_UI_USERNAME_LABEL.png.sha1
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 @@ | ||
2d957ab6bdbaafe89daa0ea6ceddebb71179267e |
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
113 changes: 113 additions & 0 deletions
113
chrome/browser/resources/password_manager/password_details_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,113 @@ | ||
<style include="shared-style cr-shared-style"> | ||
.card { | ||
margin-bottom: 44px; | ||
} | ||
|
||
.credential-container { | ||
padding: 12px var(--cr-form-field-bottom-spacing) var(--cr-section-padding); | ||
} | ||
|
||
.row-container { | ||
display: flex; | ||
margin-top: 16px; | ||
} | ||
|
||
.column-container { | ||
flex: 50%; | ||
} | ||
|
||
.button-container { | ||
border-top: var(--cr-separator-line); | ||
margin-top: 12px; | ||
padding: var(--cr-form-field-bottom-spacing) var(--cr-section-padding); | ||
} | ||
|
||
.input-field { | ||
margin-inline-end: 34px; | ||
--cr-input-padding-start: 20px; | ||
--cr-input-min-height: 40px; | ||
--cr-input-error-display: none; | ||
--cr-input-border-radius: 10px; | ||
--cr-icon-button-margin-start: 0; | ||
--cr-icon-button-margin-end: 0; | ||
} | ||
|
||
.site-link { | ||
color: var(--cr-primary-text-color); | ||
display: block; | ||
height: 20px; | ||
max-width: 324px; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
|
||
.cr-form-field-label { | ||
margin-bottom: 6px; | ||
} | ||
|
||
#passwordButtons { | ||
display: flex; | ||
} | ||
|
||
#editButton { | ||
margin-inline-end: var(--cr-button-edge-spacing); | ||
} | ||
</style> | ||
<div class="card"> | ||
<div class="credential-container"> | ||
<div class="row-container"> | ||
<div class="column-container"> | ||
<cr-input id="usernameValue" value="[[password.username]]" readonly | ||
class="input-field" label="$i18n{usernameLabel}"> | ||
<cr-icon-button id="copyUsernameButton" class="icon-copy-content" | ||
slot="inline-suffix" title="$i18n{copyUsername}"> | ||
</cr-icon-button> | ||
</cr-input> | ||
</div> | ||
<div class="column-container"> | ||
<!-- TODO(crbug.com/1350947): Support displaying apps. --> | ||
<!-- TODO(crbug.com/1350947): Support displaying multiple sites. --> | ||
<div class="cr-form-field-label">$i18n{sitesLabel}</div> | ||
<a id="linkValue" href="[[password.urls.link]]" class="site-link"> | ||
<span class="elide-left"> | ||
<span>[[password.urls.shown]]</span> | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
<div class="row-container"> | ||
<div class="column-container"> | ||
<!-- TODO(crbug.com/1350947): Support federated credentials. --> | ||
<cr-input id="passwordValue" value="[[password.password]]" | ||
type="password" readonly class="input-field" | ||
label="$i18n{passwordLabel}"> | ||
<div id="passwordButtons" slot="inline-suffix"> | ||
<cr-icon-button id="showPasswordButton" class="icon-visibility" | ||
title="$i18n{showPassword}"> | ||
</cr-icon-button> | ||
<cr-icon-button id="copyPasswordButton" class="icon-copy-content" | ||
title="$i18n{copyPassword}"> | ||
</cr-icon-button> | ||
</div> | ||
</cr-input> | ||
</div> | ||
<div class="column-container"> | ||
<!-- TODO(crbug.com/1350947): Support displaying notes. --> | ||
<cr-input id="noteValue" value="$i18n{emptyNote}" | ||
readonly class="input-field" label="$i18n{notesLabel}"> | ||
</cr-input> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="button-container"> | ||
<!-- TODO(crbug.com/1350947): Support editing. --> | ||
<cr-button id="editButton"> | ||
$i18n{editPassword} | ||
</cr-button> | ||
<!-- TODO(crbug.com/1350947): Support deleting. --> | ||
<cr-button id="deleteButton"> | ||
$i18n{deletePassword} | ||
</cr-button> | ||
</div> | ||
</div> |
58 changes: 58 additions & 0 deletions
58
chrome/browser/resources/password_manager/password_details_card.ts
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,58 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// 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_input/cr_input.js'; | ||
import 'chrome://resources/cr_elements/cr_button/cr_button.js'; | ||
import 'chrome://resources/cr_elements/cr_icons.css.js'; | ||
import 'chrome://resources/cr_elements/cr_shared_style.css.js'; | ||
import './shared_style.css.js'; | ||
|
||
import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; | ||
import {CrIconButtonElement} from 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; | ||
import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js'; | ||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {getTemplate} from './password_details_card.html.js'; | ||
|
||
export interface PasswordDetailsCardElement { | ||
$: { | ||
copyPasswordButton: CrIconButtonElement, | ||
copyUsernameButton: CrIconButtonElement, | ||
deleteButton: CrButtonElement, | ||
editButton: CrButtonElement, | ||
linkValue: HTMLElement, | ||
noteValue: CrInputElement, | ||
passwordValue: CrInputElement, | ||
showPasswordButton: CrIconButtonElement, | ||
usernameValue: CrInputElement, | ||
}; | ||
} | ||
|
||
|
||
export class PasswordDetailsCardElement extends PolymerElement { | ||
static get is() { | ||
return 'password-details-card'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
static get properties() { | ||
return { | ||
password: Object, | ||
}; | ||
} | ||
|
||
password: chrome.passwordsPrivate.PasswordUiEntry; | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'password-details-card': PasswordDetailsCardElement; | ||
} | ||
} | ||
|
||
customElements.define( | ||
PasswordDetailsCardElement.is, PasswordDetailsCardElement); |
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
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
Oops, something went wrong.