Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2257493004: Add "AutofillScanCardholderName" feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable feature by default Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/autofill_experiments.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 1eea943cd6bb46745419f9a7c33a188b2fd423c7..4ee1303a6d7f7731016cb93ac3f378f710c59fc0 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -16,6 +16,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/containers/adapters.h"
+#include "base/feature_list.h"
#include "base/files/file_util.h"
#include "base/guid.h"
#include "base/logging.h"
@@ -270,10 +271,13 @@ bool AutofillManager::ShouldShowScanCreditCard(const FormData& form,
autofill_field->Type().GetStorableType() == CREDIT_CARD_NUMBER &&
base::ContainsOnlyChars(CreditCard::StripSeparators(field.value),
base::ASCIIToUTF16("0123456789"));
- if (!is_card_number_field &&
- autofill_field->Type().GetStorableType() != CREDIT_CARD_NAME_FULL) {
+
+ bool is_scannable_name_on_card_field =
+ autofill_field->Type().GetStorableType() == CREDIT_CARD_NAME_FULL &&
+ base::FeatureList::IsEnabled(kAutofillScanCardholderName);
+
+ if (!is_card_number_field && !is_scannable_name_on_card_field)
return false;
- }
static const int kShowScanCreditCardMaxValueLength = 6;
return field.value.size() <= kShowScanCreditCardMaxValueLength;
« no previous file with comments | « components/autofill/core/browser/autofill_experiments.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698