-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Passwords] Add barebones password view page
This CL introduces a blank page for password viewing page, which will be replacing the PASSWORD_VIEW mode in password edit dialog. The future CLs will fill the page contents, handle authorization, editing, etc. Bug: 1298027 Change-Id: Id4affc6ad9b17eda3feb08aab035c8f690376215 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560448 Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Commit-Queue: Adem Derinel <derinel@google.com> Cr-Commit-Position: refs/heads/main@{#988449}
- Loading branch information
Showing
8 changed files
with
107 additions
and
1 deletion.
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
Empty file.
74 changes: 74 additions & 0 deletions
74
chrome/browser/resources/settings/autofill_page/password_view.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,74 @@ | ||
// Copyright 2022 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. | ||
|
||
/** | ||
* @fileoverview 'password-view' is the subpage containing details about the | ||
* password such as the URL, the username, the password and the note. | ||
*/ | ||
|
||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {routes} from '../route.js'; | ||
import {Route, RouteObserverMixin, RouteObserverMixinInterface, Router} from '../router.js'; | ||
import {MultiStorePasswordUiEntry} from './multi_store_password_ui_entry.js'; | ||
import {getTemplate} from './password_view.html.js'; | ||
|
||
const PasswordViewElementBase = RouteObserverMixin(PolymerElement) as { | ||
new (): PolymerElement & RouteObserverMixinInterface, | ||
}; | ||
|
||
export class PasswordViewElement extends PasswordViewElementBase { | ||
static get is() { | ||
return 'password-view'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
static get properties() { | ||
return { | ||
credential: { | ||
type: Object, | ||
value: null, | ||
notify: true, | ||
}, | ||
}; | ||
} | ||
|
||
credential: MultiStorePasswordUiEntry|null; | ||
|
||
override currentRouteChanged(route: Route) { | ||
if (route !== routes.PASSWORD_VIEW) { | ||
return; | ||
} | ||
const queryParameters = Router.getInstance().getQueryParameters(); | ||
|
||
const site = queryParameters.get('site'); | ||
if (!site) { | ||
return; | ||
} | ||
|
||
const username = queryParameters.get('username'); | ||
if (!username) { | ||
return; | ||
} | ||
|
||
// TODO(https://crbug.com/1298027): Update the credential here based on site | ||
// and username. The credential below is temporary. | ||
this.credential = { | ||
urls: { | ||
shown: site, | ||
} | ||
} as MultiStorePasswordUiEntry; | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'password-view': PasswordViewElement; | ||
} | ||
} | ||
|
||
customElements.define(PasswordViewElement.is, PasswordViewElement); |
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