Remove honorifics from Desktop address edit dialogs.
The CL is part of the removal of honorific prefixes in Autofill. This
change in particular, removes honorific prefixes Desktop address edit
dialogs.
Bug: b/320307442
Change-Id: Iff7230bb8eaf532050f503a9ee0bed642c504c5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5212146
Commit-Queue: Norge Vizcay <vizcay@google.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1248951}
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp
index 2c342e2..542d11c 100644
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -407,9 +407,6 @@
<message name="IDS_SETTINGS_AUTOFILL_ADDRESSES_EMAIL" desc="This is the label for the field that lets a user modify the email address that will be used when auto-filling forms on the web.">
Email
</message>
- <message name="IDS_SETTINGS_AUTOFILL_ADDRESS_HONORIFIC_LABEL" desc="This is the label for the field that lets the user modify the title that will be used when auto-filling forms on the web. A 'Title' field in a web form could be a prefix like Ms., Mx., or Dr. or a position held, like Captain or Rabbi." meaning="Honorific">
- Title
- </message>
<message name="IDS_SETTINGS_AUTOFILL_DETAIL" desc="Description of what toggling the 'Autofill' setting does. Immediately underneath IDS_SETTINGS_AUTOFILL">
Enable Autofill to fill out forms in a single click
</message>
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_ADDRESS_HONORIFIC_LABEL.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_ADDRESS_HONORIFIC_LABEL.png.sha1
deleted file mode 100644
index e41ef89..0000000
--- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_ADDRESS_HONORIFIC_LABEL.png.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5ebfb722ef3b61ded6608a9b84d94f05946b0980
\ No newline at end of file
diff --git a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts
index c073ef6..34bfa07 100644
--- a/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts
+++ b/chrome/browser/resources/settings/autofill_page/address_edit_dialog.ts
@@ -22,8 +22,6 @@
import {assert} from 'chrome://resources/js/assert.js';
import {flush, microTask, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
-import {loadTimeData} from '../i18n_setup.js';
-
import {getTemplate} from './address_edit_dialog.html.js';
import * as uiComponents from './address_edit_dialog_components.js';
@@ -91,16 +89,6 @@
type: String,
computed: 'getAccountAddressSourceNotice_(address, accountInfo)',
},
-
- /**
- * True if honorifics are enabled.
- */
- showHonorific_: {
- type: Boolean,
- value() {
- return loadTimeData.getBoolean('showHonorific');
- },
- },
};
}
@@ -123,7 +111,6 @@
private components_: uiComponents.AddressComponentUi[][] = [];
private canSave_: boolean;
private isAccountAddress_: boolean;
- private showHonorific_: boolean;
private countryInfo_: CountryDetailManager =
CountryDetailManagerImpl.getInstance();
@@ -192,14 +179,6 @@
this.components_ = [];
for (const row of format.components) {
- // If this is the name field, add a honorific title row before it.
- if (row.row[0].field === FieldType.NAME_FULL && this.showHonorific_) {
- this.components_.push([new uiComponents.AddressComponentUi(
- this.addressFields_, this.originalAddressFields_,
- FieldType.NAME_HONORIFIC_PREFIX, this.i18n('honorificLabel'),
- 'long')]);
- }
-
this.components_.push(row.row.map(
component => new uiComponents.AddressComponentUi(
this.addressFields_, this.originalAddressFields_,
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
index cfb29a37..5fd8f3e5 100644
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -1040,7 +1040,6 @@
{"addressCountry", IDS_SETTINGS_AUTOFILL_ADDRESSES_COUNTRY},
{"addressPhone", IDS_SETTINGS_AUTOFILL_ADDRESSES_PHONE},
{"addressEmail", IDS_SETTINGS_AUTOFILL_ADDRESSES_EMAIL},
- {"honorificLabel", IDS_SETTINGS_AUTOFILL_ADDRESS_HONORIFIC_LABEL},
{"creditCardDescription", IDS_SETTINGS_AUTOFILL_CARD_DESCRIPTION},
{"creditCardA11yLabeled", IDS_SETTINGS_AUTOFILL_CARD_A11Y_LABELED},
{"creditCardExpDateA11yLabeled",
@@ -1247,12 +1246,6 @@
"undoDescription",
l10n_util::GetStringFUTF16(IDS_UNDO_DESCRIPTION,
undo_accelerator.GetShortcutText()));
-
- html_source->AddBoolean(
- "showHonorific",
- base::FeatureList::IsEnabled(
- autofill::features::kAutofillEnableSupportForHonorificPrefixes));
-
html_source->AddString(
"unenrollVirtualCardDialogLabel",
l10n_util::GetStringFUTF16(
diff --git a/chrome/test/data/webui/settings/autofill_section_test.ts b/chrome/test/data/webui/settings/autofill_section_test.ts
index b8799c23..f421bb12 100644
--- a/chrome/test/data/webui/settings/autofill_section_test.ts
+++ b/chrome/test/data/webui/settings/autofill_section_test.ts
@@ -540,28 +540,6 @@
});
});
- test('verifyHonorificIsSaved', async function() {
- loadTimeData.overrideValues({showHonorific: true});
- const address = createEmptyAddressEntry();
- const dialog = await createAddressDialog(address);
- const honorificElement =
- dialog.$.dialog.querySelectorAll<CrTextareaElement|CrInputElement>(
- 'cr-textarea, cr-input')[0]!;
- assertEquals(undefined, honorificElement.value);
- assertFalse(
- !!getAddressFieldValue(address, FieldType.NAME_HONORIFIC_PREFIX));
-
- const honorific = 'Lord';
- honorificElement.value = honorific;
-
- await expectEvent(
- dialog, 'save-address', () => dialog.$.saveButton.click());
- assertEquals(honorific, honorificElement.value);
- assertEquals(
- honorific,
- getAddressFieldValue(address, FieldType.NAME_HONORIFIC_PREFIX));
- });
-
// TODO(crbug.com/1473847): Fix the flakiness.
test.skip('verifyPhoneAndEmailAreRemoved', function() {
const address = createEmptyAddressEntry();
@@ -612,7 +590,6 @@
// save button is enabled, then it will clear the field and verify that the
// save button is disabled. Test passes after all elements have been tested.
test('verifySaveIsNotClickableIfAllInputFieldsAreEmpty', async function() {
- loadTimeData.overrideValues({showHonorific: true});
const dialog = await createAddressDialog(createEmptyAddressEntry());
const saveButton = dialog.$.saveButton;
const testElements =
@@ -627,10 +604,10 @@
countrySelect.dispatchEvent(new CustomEvent('change'));
});
- // Default country is 'US' expecting: Honorific, Name, Organization,
+ // Default country is 'US' expecting: Name, Organization,
// Street address, City, State, ZIP code, Phone, and Email.
- // Unless Company name or honorific is disabled.
- assertEquals(9, testElements.length);
+ // Unless Company name is disabled.
+ assertEquals(8, testElements.length);
assertTrue(saveButton.disabled);
for (const element of testElements) {
@@ -759,14 +736,9 @@
// US address has 3 fields on the same line.
test('verifyEditingUSAddress', function() {
- loadTimeData.overrideValues({showHonorific: true});
const address = createEmptyAddressEntry();
address.fields = [
- {
- type: FieldType.NAME_HONORIFIC_PREFIX,
- value: 'Honorific',
- },
{type: FieldType.NAME_FULL, value: 'Name'},
{type: FieldType.COMPANY_NAME, value: 'Organization'},
{
@@ -784,7 +756,7 @@
return createAddressDialog(address).then(function(dialog) {
const rows = dialog.$.dialog.querySelectorAll('.address-row');
- assertEquals(7, rows.length);
+ assertEquals(6, rows.length);
let index = 0;
// Country
@@ -795,18 +767,9 @@
'United States',
countrySelect!.selectedOptions[0]!.textContent!.trim());
index++;
- // Honorific
- row = rows[index]!;
- let cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
- '.address-column');
- assertEquals(1, cols.length);
- assertEquals(
- getAddressFieldValue(address, FieldType.NAME_HONORIFIC_PREFIX),
- cols[0]!.value);
- index++;
// Name
row = rows[index]!;
- cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
+ let cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
'.address-column');
assertEquals(1, cols.length);
assertEquals(
@@ -861,11 +824,9 @@
// GB address has 1 field per line for all lines that change.
test('verifyEditingGBAddress', function() {
- loadTimeData.overrideValues({showHonorific: true});
const address = createEmptyAddressEntry();
address.fields = [
- {type: FieldType.NAME_HONORIFIC_PREFIX, value: 'Lord'},
{type: FieldType.NAME_FULL, value: 'Name'},
{type: FieldType.COMPANY_NAME, value: 'Organization'},
{
@@ -882,7 +843,7 @@
return createAddressDialog(address).then(function(dialog) {
const rows = dialog.$.dialog.querySelectorAll('.address-row');
- assertEquals(9, rows.length);
+ assertEquals(8, rows.length);
let index = 0;
// Country
@@ -893,18 +854,9 @@
'United Kingdom',
countrySelect!.selectedOptions[0]!.textContent!.trim());
index++;
- // Honorific
- row = rows[index]!;
- let cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
- '.address-column');
- assertEquals(1, cols.length);
- assertEquals(
- getAddressFieldValue(address, FieldType.NAME_HONORIFIC_PREFIX),
- cols[0]!.value);
- index++;
// Name
row = rows[index]!;
- cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
+ let cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
'.address-column');
assertEquals(1, cols.length);
assertEquals(
@@ -972,14 +924,8 @@
// IL address has 2 fields on the same line and is an RTL locale.
// RTL locale shouldn't affect this test.
test('verifyEditingILAddress', function() {
- loadTimeData.overrideValues({showHonorific: true});
const address = createEmptyAddressEntry();
-
address.fields = [
- {
- type: FieldType.NAME_HONORIFIC_PREFIX,
- value: 'Honorific',
- },
{type: FieldType.NAME_FULL, value: 'Name'},
{type: FieldType.COMPANY_NAME, value: 'Organization'},
{
@@ -996,7 +942,7 @@
return createAddressDialog(address).then(function(dialog) {
const rows = dialog.$.dialog.querySelectorAll('.address-row');
- assertEquals(7, rows.length);
+ assertEquals(6, rows.length);
let index = 0;
// Country
@@ -1006,18 +952,9 @@
assertEquals(
'Israel', countrySelect!.selectedOptions[0]!.textContent!.trim());
index++;
- // Honorific
- row = rows[index]!;
- let cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
- '.address-column');
- assertEquals(1, cols.length);
- assertEquals(
- getAddressFieldValue(address, FieldType.NAME_HONORIFIC_PREFIX),
- cols[0]!.value);
- index++;
// Name
row = rows[index]!;
- cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
+ let cols = row.querySelectorAll<CrTextareaElement|CrInputElement>(
'.address-column');
assertEquals(1, cols.length);
assertEquals(
@@ -1070,9 +1007,8 @@
// US has an extra field 'State'. Validate that this field is
// persisted when switching to IL then back to US.
test('verifyAddressPersistanceWhenSwitchingCountries', function() {
- loadTimeData.overrideValues({showHonorific: true});
const address = createEmptyAddressEntry();
- const experimental_fields_count = 2;
+ const experimental_fields_count = 1;
address.fields.push({type: FieldType.ADDRESS_HOME_COUNTRY, value: 'US'});
return createAddressDialog(address).then(function(dialog) {