Skip to content

Commit

Permalink
Merge-72 [AF] Check comp.name flag when showing address in settings ios
Browse files Browse the repository at this point in the history
  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.


TBR=jeffreycohen@chromium.org

(cherry picked from commit 7125779)

Bug: 890972
Change-Id: I179ccfd9cf0cef9eaa9f80cd0c2b7353dd5c8f9a
Reviewed-on: https://chromium-review.googlesource.com/c/1351282
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#612729}
Reviewed-on: https://chromium-review.googlesource.com/c/1358699
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/branch-heads/3626@{#8}
Cr-Branched-From: d897fb1-refs/heads/master@{#612437}
  • Loading branch information
sebsg committed Dec 3, 2018
1 parent e8d7195 commit 5928de1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -186,6 +187,13 @@ - (void)loadModel {
[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);
Expand Down

0 comments on commit 5928de1

Please sign in to comment.