Commit 111fd504 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

Revert "[b4p/Settings] Add dialog for removing duplicated passwords"

This reverts commit 39818338.

Reason for revert: crbug.com/1096758 Linux Tests (dbg) was failing

Original change's description:
> [b4p/Settings] Add dialog for removing duplicated passwords
> 
> For a b4p user, in case some password has copies attached both to the
> device and the Google Account, attempting to delete it should show a
> dialog that allows selecting which copies to remove. This CL implements
> this dialog but does not yet wire it in. Some details in the UI are left
> for future CLs, such as the user avatar and displaying the website
> associated with the password to be deleted. Note RemovePasswordBehavior
> is not used here, for reasons that are better explained in
> crrev.com/c/2246157.
> 
> Screenshot of implementation:
> https://screenshot.googleplex.com/hZnTiuy80tL
> 
> Screenshot of mock:
> https://screenshot.googleplex.com/pGV0iMTQBxw
> 
> Bug: 1049141
> Change-Id: I50ca0e5bfc99dbc76c12c345c00f82788bbc377c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248180
> Commit-Queue: Victor Vianna <victorvianna@google.com>
> Reviewed-by: Friedrich [CET] <fhorschig@chromium.org>
> Reviewed-by: Esmael Elmoslimany <aee@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#779743}

TBR=fhorschig@chromium.org,aee@chromium.org,victorvianna@google.com

Change-Id: I831cf3e91df28d1dabaeb1bfd14206206f79baba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1049141
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2252575Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780044}
parent b5e2f635
...@@ -502,25 +502,6 @@ ...@@ -502,25 +502,6 @@
<message name="IDS_SETTINGS_PASSWORD_MOVE_TO_ACCOUNT_DIALOG_CANCEL_BUTTON_TEXT" desc="Text for the button that cancels the action of moving a password to the user Google Account."> <message name="IDS_SETTINGS_PASSWORD_MOVE_TO_ACCOUNT_DIALOG_CANCEL_BUTTON_TEXT" desc="Text for the button that cancels the action of moving a password to the user Google Account.">
No, thanks No, thanks
</message> </message>
<message name="IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_TITLE" desc="Title for the dialog that asks the user which versions of a password to remove (device, Google Account or both).">
Delete password?
</message>
<!-- TODO(crbug.com/1049141): Inject the website in the string and make it translateable. -->
<message translateable="false" name="IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_BODY" desc="Description message for the dialog that asks the user which versions of a password to remove (device, Google Account or both).">
Your password is stored on this device and in your Google Account. Which one do you want to delete?
</message>
<message name="IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_REMOVE_BUTTON_TEXT" desc="Text for the button that confirms the action in the dialog that asks the user which versions of a password to remove (device, Google Account or both).">
Delete
</message>
<message name="IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_CANCEL_BUTTON_TEXT" desc="Text for the button that cancels the action in the dialog that asks the user which versions of a password to remove (device, Google Account or both).">
Cancel
</message>
<message name="IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_FROM_ACCOUNT_CHECKBOX_LABEL" desc="The label for the checkbox that represents whether the user wishes to remove a password from their Google Account.">
From your Google Account
</message>
<message name="IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_FROM_DEVICE_CHECKBOX_LABEL" desc="The label for the checkbox that represents whether the user wishes to remove a password from the device.">
From this device
</message>
<message name="IDS_SETTINGS_DEVICE_PASSWORDS_LINK_LABEL_SINGULAR" desc="The label for the link on settings leading to the 'device passwords' page, when there is 1 device password."> <message name="IDS_SETTINGS_DEVICE_PASSWORDS_LINK_LABEL_SINGULAR" desc="The label for the link on settings leading to the 'device passwords' page, when there is 1 device password.">
You have 1 password saved on this device You have 1 password saved on this device
</message> </message>
......
dd66596c8a7de9dc2831bf3fdae4a81846b4e263
\ No newline at end of file
...@@ -31,7 +31,6 @@ js_type_check("closure_compile_module") { ...@@ -31,7 +31,6 @@ js_type_check("closure_compile_module") {
":password_manager_proxy", ":password_manager_proxy",
":password_move_to_account_dialog", ":password_move_to_account_dialog",
":password_remove_confirmation_dialog", ":password_remove_confirmation_dialog",
":password_remove_dialog",
":passwords_device_section", ":passwords_device_section",
":passwords_export_dialog", ":passwords_export_dialog",
":passwords_list_handler", ":passwords_list_handler",
...@@ -210,7 +209,6 @@ js_library("passwords_list_handler") { ...@@ -210,7 +209,6 @@ js_library("passwords_list_handler") {
":password_edit_dialog", ":password_edit_dialog",
":password_manager_proxy", ":password_manager_proxy",
":password_move_to_account_dialog", ":password_move_to_account_dialog",
":password_remove_dialog",
":remove_password_behavior", ":remove_password_behavior",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu.m", "//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu.m",
...@@ -239,17 +237,6 @@ js_library("password_manager_proxy") { ...@@ -239,17 +237,6 @@ js_library("password_manager_proxy") {
chrome_extension_public_externs + [ "$externs_path/passwords_private.js" ] chrome_extension_public_externs + [ "$externs_path/passwords_private.js" ]
} }
js_library("password_remove_dialog") {
deps = [
":multi_store_password_ui_entry",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_button:cr_button.m",
"//ui/webui/resources/cr_elements/cr_checkbox:cr_checkbox.m",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m",
"//ui/webui/resources/js:assert.m",
]
}
js_library("passwords_export_dialog") { js_library("passwords_export_dialog") {
deps = [ deps = [
":blocking_request_manager", ":blocking_request_manager",
...@@ -380,7 +367,6 @@ html_to_js("web_components") { ...@@ -380,7 +367,6 @@ html_to_js("web_components") {
"password_check_list_item.js", "password_check_list_item.js",
"password_check.js", "password_check.js",
"password_edit_dialog.js", "password_edit_dialog.js",
"password_remove_dialog.js",
"password_list_item.js", "password_list_item.js",
"password_move_to_account_dialog.js", "password_move_to_account_dialog.js",
"password_remove_confirmation_dialog.js", "password_remove_confirmation_dialog.js",
......
<style>
cr-checkbox {
display: flex;
padding: 10px 8px;
}
.checkbox-label {
color: var(--google-grey-800);
}
</style>
<cr-dialog id="dialog" close-text="$i18n{close}">
<div slot="title">$i18n{passwordRemoveDialogTitle}</div>
<div slot="body">
<!-- TODO(crbug.com/1049141): Display the website and avatar. -->
<div>
$i18n{passwordRemoveDialogBody}
</div>
<cr-checkbox checked="{{removeFromAccountChecked_}}"
id="removeFromAccountCheckbox">
<div class="checkbox-label">
$i18n{passwordRemoveDialogFromAccountCheckboxLabel}
</div>
</cr-checkbox>
<cr-checkbox checked="{{removeFromDeviceChecked_}}"
id="removeFromDeviceCheckbox">
<div class="checkbox-label">
$i18n{passwordRemoveDialogFromDeviceCheckboxLabel}
</div>
</cr-checkbox>
</div>
<div slot="button-container">
<cr-button class="cancel-button" id="cancelButton"
on-click="onCancelButtonClick_">
$i18n{passwordRemoveDialogCancelButtonText}
</cr-button>
<cr-button class="action-button" id="removeButton"
disabled="[[shouldDisableRemoveButton_(removeFromAccountChecked_,
removeFromDeviceChecked_)]]"
on-click="onRemoveButtonClick_">
$i18n{passwordRemoveDialogRemoveButtonText}
</cr-button>
</div>
</cr-dialog>
// 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.
/**
* @fileoverview PasswordRemoveDialog is a dialog for choosing which copies of
* a duplicated password to remove. A duplicated password is one that is stored
* both on the device and in the account. If the user chooses to remove at least
* one copy, a password-remove-dialog-passwords-removed event informs listeners
* which copies were deleted.
*/
import 'chrome://resources/cr_elements/cr_button/cr_button.m.js';
import 'chrome://resources/cr_elements/cr_checkbox/cr_checkbox.m.js';
import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.m.js';
import {assert} from 'chrome://resources/js/assert.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {MultiStorePasswordUiEntry} from './multi_store_password_ui_entry';
import {PasswordManagerImpl} from './password_manager_proxy';
/**
* @typedef {!Event<!{removedFromAccount:boolean, removedFromDevice: boolean}>}
*/
export let PasswordRemoveDialogPasswordsRemovedEvent;
Polymer({
is: 'password-remove-dialog',
_template: html`{__html_template__}`,
properties: {
/**
* The password whose copies are to be removed.
* @type {!MultiStorePasswordUiEntry}
*/
duplicatedPassword: Object,
/**
* @private
*/
removeFromAccountChecked_: {
type: Boolean,
// Both checkboxes are selected by default (see |removeFromDeviceChecked_|
// as well), since removing from both locations is the most common case.
value: true,
},
/**
* @private
*/
removeFromDeviceChecked_: {
type: Boolean,
value: true,
},
},
/** @override */
attached() {
// At creation time, the password should exist in both locations.
assert(
this.duplicatedPassword.isPresentInAccount() &&
this.duplicatedPassword.isPresentOnDevice());
this.$.dialog.showModal();
},
/**
* @private
*/
onRemoveButtonClick_() {
/** @type{!Array<number>} */
const idsToRemove = [];
if (this.removeFromAccountChecked_) {
idsToRemove.push(this.duplicatedPassword.accountId);
}
if (this.removeFromDeviceChecked_) {
idsToRemove.push(this.duplicatedPassword.deviceId);
}
PasswordManagerImpl.getInstance().removeSavedPasswords(idsToRemove);
this.$.dialog.close();
this.fire('password-remove-dialog-passwords-removed', {
removedFromAccount: this.removeFromAccountChecked_,
removedFromDevice: this.removeFromDeviceChecked_
});
},
/**
* @private
*/
onCancelButtonClick_() {
this.$.dialog.close();
},
/**
* @private
* @return {boolean}
*/
shouldDisableRemoveButton_() {
return !this.removeFromAccountChecked_ && !this.removeFromDeviceChecked_;
}
});
...@@ -160,11 +160,6 @@ ...@@ -160,11 +160,6 @@
use_base_dir="false" use_base_dir="false"
compress="false" type="BINDATA" compress="false" type="BINDATA"
preprocess="true" /> preprocess="true" />
<include name="IDR_SETTINGS_AUTOFILL_PAGE_PASSWORD_REMOVE_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/autofill_page/password_remove_dialog.js"
use_base_dir="false"
compress="false" type="BINDATA"
preprocess="true" />
<include name="IDR_SETTINGS_AUTOFILL_PAGE_PASSWORDS_EXPORT_DIALOG_JS" <include name="IDR_SETTINGS_AUTOFILL_PAGE_PASSWORDS_EXPORT_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/autofill_page/passwords_export_dialog.js" file="${root_gen_dir}/chrome/browser/resources/settings/autofill_page/passwords_export_dialog.js"
use_base_dir="false" use_base_dir="false"
......
...@@ -924,16 +924,6 @@ void AddAutofillStrings(content::WebUIDataSource* html_source, ...@@ -924,16 +924,6 @@ void AddAutofillStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_PASSWORD_MOVE_TO_ACCOUNT_DIALOG_MOVE_BUTTON_TEXT}, IDS_SETTINGS_PASSWORD_MOVE_TO_ACCOUNT_DIALOG_MOVE_BUTTON_TEXT},
{"passwordMoveToAccountDialogCancelButtonText", {"passwordMoveToAccountDialogCancelButtonText",
IDS_SETTINGS_PASSWORD_MOVE_TO_ACCOUNT_DIALOG_CANCEL_BUTTON_TEXT}, IDS_SETTINGS_PASSWORD_MOVE_TO_ACCOUNT_DIALOG_CANCEL_BUTTON_TEXT},
{"passwordRemoveDialogTitle", IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_TITLE},
{"passwordRemoveDialogBody", IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_BODY},
{"passwordRemoveDialogRemoveButtonText",
IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_REMOVE_BUTTON_TEXT},
{"passwordRemoveDialogCancelButtonText",
IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_CANCEL_BUTTON_TEXT},
{"passwordRemoveDialogFromAccountCheckboxLabel",
IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_FROM_ACCOUNT_CHECKBOX_LABEL},
{"passwordRemoveDialogFromDeviceCheckboxLabel",
IDS_SETTINGS_PASSWORD_REMOVE_DIALOG_FROM_DEVICE_CHECKBOX_LABEL},
{"devicePasswordsLinkLabelSingular", {"devicePasswordsLinkLabelSingular",
IDS_SETTINGS_DEVICE_PASSWORDS_LINK_LABEL_SINGULAR}, IDS_SETTINGS_DEVICE_PASSWORDS_LINK_LABEL_SINGULAR},
{"devicePasswordsLinkLabelPlural", {"devicePasswordsLinkLabelPlural",
......
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