-
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.
[Autofill] Prompt before removing a local credit card.
This CL adds a confirmation dialog to confirm a user's intent to remove a locally stored credit card in settings. This aligns the experience for removing local credit cards with that of addresses. The CL also changes the word 'Remove' to 'Delete', in line with the same change made to addresses in https://crrev.com/a5094829015 It was adapted from initial work done by schwering@ in https://chromium-review.googlesource.com/c/chromium/src/+/3501833 Bug: 1301287 Change-Id: I294ce7faaa09265cefeff6de79d685385321cba9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219354 Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Reviewed-by: Christoph Schwering <schwering@google.com> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Friedrich Horschig <fhorschig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1103276}
- Loading branch information
1 parent
37526a7
commit 4643d3c
Showing
11 changed files
with
192 additions
and
15 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
...pp/settings_strings_grdp/IDS_SETTINGS_LOCAL_CARD_REMOVE_CONFIRMATION_DESCRIPTION.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 @@ | ||
1bf450d14bc37b72be4a5440c891c4fbec2b24d5 |
1 change: 1 addition & 0 deletions
1
chrome/app/settings_strings_grdp/IDS_SETTINGS_LOCAL_CARD_REMOVE_CONFIRMATION_TITLE.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 @@ | ||
d09b299f0af1dd52ab535d74ab0f9f9a4534c491 |
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
12 changes: 12 additions & 0 deletions
12
...rowser/resources/settings/autofill_page/local_credit_card_remove_confirmation_dialog.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,12 @@ | ||
<cr-dialog show-on-attach id="dialog" close-text="$i18n{close}"> | ||
<div slot="title">$i18n{removeLocalCreditCardConfirmationTitle}</div> | ||
<div slot="body">$i18n{removeLocalCreditCardConfirmationDescription}</div> | ||
<div slot="button-container"> | ||
<cr-button class="cancel-button" on-click="onCancelClick_" id="cancel"> | ||
$i18n{cancel} | ||
</cr-button> | ||
<cr-button class="action-button" on-click="onRemoveClick_" id="remove"> | ||
$i18n{delete} | ||
</cr-button> | ||
</div> | ||
</cr-dialog> |
58 changes: 58 additions & 0 deletions
58
.../browser/resources/settings/autofill_page/local_credit_card_remove_confirmation_dialog.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 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* @fileoverview 'local-credit-card-remove-confirmation-dialog' is the dialog | ||
* that allows removing a locally saved credit card. | ||
*/ | ||
import 'chrome://resources/cr_elements/cr_button/cr_button.js'; | ||
import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; | ||
|
||
import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; | ||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {getTemplate} from './local_credit_card_remove_confirmation_dialog.html.js'; | ||
|
||
|
||
export interface SettingsLocalCreditCardRemoveConfirmationDialogElement { | ||
$: { | ||
dialog: CrDialogElement, | ||
remove: HTMLElement, | ||
cancel: HTMLElement, | ||
}; | ||
} | ||
|
||
export class SettingsLocalCreditCardRemoveConfirmationDialogElement extends | ||
PolymerElement { | ||
static get is() { | ||
return 'settings-local-credit-card-remove-confirmation-dialog'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
wasConfirmed(): boolean { | ||
return this.$.dialog.getNative().returnValue === 'success'; | ||
} | ||
|
||
private onRemoveClick_() { | ||
this.$.dialog.close(); | ||
} | ||
|
||
private onCancelClick_() { | ||
this.$.dialog.cancel(); | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'settings-local-credit-card-remove-confirmation-dialog': | ||
SettingsLocalCreditCardRemoveConfirmationDialogElement; | ||
} | ||
} | ||
|
||
customElements.define( | ||
SettingsLocalCreditCardRemoveConfirmationDialogElement.is, | ||
SettingsLocalCreditCardRemoveConfirmationDialogElement); |
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