Commit 71257796 authored by Jeffrey Cohen's avatar Jeffrey Cohen Committed by Commit Bot

[autofill] Respect company name flag when presenting users with address

autofill settings on ios

  Before this CL, when autofilling addresses, the company name was always
filled in if it was specified as part of a country's address fields.

  However, we want to remove the company field from autofill. This is being
rolled out via a Flag and finch config.

  The initial CL that addressed this in https://crrev.com/c/1315536 did not
change to IOS settings, but this CL updates the IOS code to
filter out the company field in settings addresses based on the flag.


Bug: 890972
Change-Id: I179ccfd9cf0cef9eaa9f80cd0c2b7353dd5c8f9a
Reviewed-on: https://chromium-review.googlesource.com/c/1351282
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612729}
parent 9ff9445e
......@@ -11,6 +11,7 @@
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/payments/payments_service_url.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/common/autofill_features.h"
#include "ios/chrome/browser/application_context.h"
#import "ios/chrome/browser/ui/autofill/autofill_ui_type.h"
#import "ios/chrome/browser/ui/autofill/autofill_ui_type_util.h"
......@@ -186,6 +187,13 @@ static const AutofillFieldDisplayInfo kFieldsToDisplay[] = {
[model addSectionWithIdentifier:SectionIdentifierFields];
for (size_t i = 0; i < base::size(kFieldsToDisplay); ++i) {
const AutofillFieldDisplayInfo& field = kFieldsToDisplay[i];
if ((field.autofillType == autofill::COMPANY_NAME) &&
!base::FeatureList::IsEnabled(
autofill::features::kAutofillEnableCompanyName)) {
continue;
}
AutofillEditItem* item =
[[AutofillEditItem alloc] initWithType:ItemTypeField];
item.textFieldName = l10n_util::GetNSString(field.displayStringID);
......
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