Commit ffdf17b0 authored by estade's avatar estade Committed by Commit bot

Retry aa3219ce:

Limit form-less Autofilling to pages that look like checkout pages.

This should hopefully stem the tide of false positives on non-checkout pages, while preserving desired behavior on Best Buy and Apple checkout.

Fixing FormStructureBrowserTests: I went back and added <form>s that were present in the source pages but not in the local copies. I also added the original <title> tags, except for ones that did /not/ include any of the checkout keywords. For these, I added the checkout keywords to the title, so that the test still had some value (instead of passing trivially because the title was "Google Calendar" and not something like "Payment information").

BUG=471090, 477466
original review: https://codereview.chromium.org/1081803003/
TBR=brettw@chromium.org, thestig@chromium.org

Review URL: https://codereview.chromium.org/1111583002

Cr-Commit-Position: refs/heads/master@{#327215}
parent 5671403d
......@@ -2,7 +2,7 @@
<!-- Autofill test with dynamically created fields, and without a form tag. -->
<html>
<head>
<title>Dynamic Autofill Test - No Form</title>
<title>Dynamic Autofill Test - No Form - Collects address information</title>
<script>
function AddFields() {
var fields = document.getElementById("fields");
......
<head><title>L.L.Bean Secure Checkout:</title></head>
<form id="stepShippingForm" name="stepShippingForm" class="formElements container_12" autocomplete="off">
<div>
<div><select id="shipPersonTitle" name="_1_personTitle" selectedtitle=""> <option value="" selected="selected">Title (optional)</option> <option value="Mr."> Mr.</option> <option value="Mrs."> Mrs.</option> <option value="Ms."> Ms.</option> <option value="Dr."> Dr.</option> <option value="Sir"> Sir</option> </select> </div>
<div><label for="shipFirstName">First Name&nbsp; </label><input value="" id="shipFirstName" maxlength="20" name="_1_firstName" type="text" autocomplete="off" autocapitalize="on" autocorrect="off"> <span></span><div></div></div>
......@@ -30,3 +32,4 @@
<div id="shipLocaleMessage"></div><br>
<div> <span> <div><input name="un_jtt_cktbtn_0" type="submit" value="Continue to Billing Address" myclass=""></div> </span> <div><a data-address="" data-step="payment">Return to Previous Recipient</a></div> <div><a data-address="" data-step="payment" href="/shoppingbag.html">Return to Shopping Bag</a></div> <div><a data-address="" data-step="payment" href="/checkout.html#payment">Cancel</a></div> </div>
</div>
</form>
<form id="checkoutCommand" class="stdForm" action="/checkout" method="post"> <fieldset id="shipAdr">
<ol>
<li>
<label for="address.name">* Name <span class="fText">(first and last)</span>: </label>
......@@ -93,3 +95,4 @@
</span>
</li>
</ol>
</form>
<html>
<head></head>
<head><title>Google+ - terms to make this test non-trivial: payment checkout address</title></head>
<body>
<input type="text name="hist_state" id="hist_state" style="display: none;">
<div class="g-h-f-ci g-h-f-Au">
......
<html>
<head></head>
<head><title>Google+ - terms to make this test non-trivial: payment checkout address</title></head>
<body>
<input type="text name="hist_state" id="hist_state" style="display: none;">
<div class="g-h-f-ci g-h-f-Au">
......
<head>
<title>Google.com - Calendar - terms to make this test non-trivial: payments checkout address</title>
</head>
<div class="ep" data-eid="foo">
<div class="ep-ea noprint">
<div id=":27.print-btn" class="ep-ea-btn-wrapper ep-ea-print-btn">
......
<head>
<title><title>payment instructions - Google Slides</title></title>
</head>
<div class="modal-dialog-content">
<div class="simple-sharing-contents">
<div class="simple-sharing-link-area">
......
<head>
<title>Google+ - terms to make this test non-trivial: payment checkout address</title>
</head>
<input name="hist_state" type="text"></input>
<input placeholder="Location (optional)" type="text"></input>
<input name="sbdp" placeholder="+ Invite names, circles, or email addresses" type="text"></input>
<head>
<title>Google Developers Console</title>
</head>
<form class="p6n-billing-freetrial-signup-form p6n-align-left p6n-form ng-pristine ng-scope ng-invalid ng-invalid-required" name="controller.signupForm">
<div class="creation-form-content" data-value="creditCard">
<div id="creditCardForm" class="instrument-form payments-instruments-creditcard" data-component-name="CREDIT_CARD">
<div class="b3-credit-card-field b3-card-number-input-container"><img class="b3id-detected-card-icon card-icon-images-row" style="display: none;">
......@@ -180,3 +184,4 @@
<input type="hidden" id="creditCardForm.supportedCountries" name="supportedCountries" value="[&quot;AD&quot;,&quot;AE&quot;,&quot;AF&quot;,&quot;AG&quot;,&quot;AI&quot;,&quot;AL&quot;,&quot;AM&quot;,&quot;AO&quot;,&quot;AQ&quot;,&quot;AR&quot;,&quot;AS&quot;,&quot;AT&quot;,&quot;AU&quot;,&quot;AW&quot;,&quot;AZ&quot;,&quot;BA&quot;,&quot;BB&quot;,&quot;BD&quot;,&quot;BE&quot;,&quot;BF&quot;,&quot;BG&quot;,&quot;BH&quot;,&quot;BI&quot;,&quot;BJ&quot;,&quot;BM&quot;,&quot;BN&quot;,&quot;BO&quot;,&quot;BR&quot;,&quot;BS&quot;,&quot;BT&quot;,&quot;BV&quot;,&quot;BW&quot;,&quot;BY&quot;,&quot;BZ&quot;,&quot;CA&quot;,&quot;CC&quot;,&quot;CD&quot;,&quot;CF&quot;,&quot;CG&quot;,&quot;CH&quot;,&quot;CI&quot;,&quot;CK&quot;,&quot;CL&quot;,&quot;CM&quot;,&quot;CN&quot;,&quot;CO&quot;,&quot;CR&quot;,&quot;CV&quot;,&quot;CX&quot;,&quot;CY&quot;,&quot;CZ&quot;,&quot;DE&quot;,&quot;DJ&quot;,&quot;DK&quot;,&quot;DM&quot;,&quot;DO&quot;,&quot;DZ&quot;,&quot;EC&quot;,&quot;EE&quot;,&quot;EG&quot;,&quot;EH&quot;,&quot;ER&quot;,&quot;ES&quot;,&quot;ET&quot;,&quot;FI&quot;,&quot;FJ&quot;,&quot;FK&quot;,&quot;FM&quot;,&quot;FO&quot;,&quot;FR&quot;,&quot;GA&quot;,&quot;GB&quot;,&quot;GD&quot;,&quot;GE&quot;,&quot;GF&quot;,&quot;GH&quot;,&quot;GI&quot;,&quot;GL&quot;,&quot;GM&quot;,&quot;GN&quot;,&quot;GP&quot;,&quot;GQ&quot;,&quot;GR&quot;,&quot;GS&quot;,&quot;GT&quot;,&quot;GU&quot;,&quot;GW&quot;,&quot;GY&quot;,&quot;HK&quot;,&quot;HM&quot;,&quot;HN&quot;,&quot;HR&quot;,&quot;HT&quot;,&quot;HU&quot;,&quot;ID&quot;,&quot;IE&quot;,&quot;IL&quot;,&quot;IN&quot;,&quot;IO&quot;,&quot;IQ&quot;,&quot;IS&quot;,&quot;IT&quot;,&quot;JM&quot;,&quot;JO&quot;,&quot;JP&quot;,&quot;KE&quot;,&quot;KG&quot;,&quot;KH&quot;,&quot;KI&quot;,&quot;KM&quot;,&quot;KN&quot;,&quot;KR&quot;,&quot;KW&quot;,&quot;KY&quot;,&quot;KZ&quot;,&quot;LA&quot;,&quot;LB&quot;,&quot;LC&quot;,&quot;LI&quot;,&quot;LK&quot;,&quot;LR&quot;,&quot;LS&quot;,&quot;LT&quot;,&quot;LU&quot;,&quot;LV&quot;,&quot;LY&quot;,&quot;MA&quot;,&quot;MC&quot;,&quot;MD&quot;,&quot;ME&quot;,&quot;MG&quot;,&quot;MH&quot;,&quot;MK&quot;,&quot;ML&quot;,&quot;MN&quot;,&quot;MO&quot;,&quot;MP&quot;,&quot;MQ&quot;,&quot;MR&quot;,&quot;MS&quot;,&quot;MT&quot;,&quot;MU&quot;,&quot;MV&quot;,&quot;MW&quot;,&quot;MX&quot;,&quot;MY&quot;,&quot;MZ&quot;,&quot;NA&quot;,&quot;NC&quot;,&quot;NE&quot;,&quot;NF&quot;,&quot;NG&quot;,&quot;NI&quot;,&quot;NL&quot;,&quot;NO&quot;,&quot;NP&quot;,&quot;NR&quot;,&quot;NU&quot;,&quot;NZ&quot;,&quot;OM&quot;,&quot;PA&quot;,&quot;PE&quot;,&quot;PF&quot;,&quot;PG&quot;,&quot;PH&quot;,&quot;PK&quot;,&quot;PL&quot;,&quot;PM&quot;,&quot;PN&quot;,&quot;PR&quot;,&quot;PS&quot;,&quot;PT&quot;,&quot;PW&quot;,&quot;PY&quot;,&quot;QA&quot;,&quot;RE&quot;,&quot;RO&quot;,&quot;RS&quot;,&quot;RU&quot;,&quot;RW&quot;,&quot;SA&quot;,&quot;SB&quot;,&quot;SC&quot;,&quot;SE&quot;,&quot;SG&quot;,&quot;SH&quot;,&quot;SI&quot;,&quot;SJ&quot;,&quot;SK&quot;,&quot;SL&quot;,&quot;SM&quot;,&quot;SN&quot;,&quot;SO&quot;,&quot;SR&quot;,&quot;ST&quot;,&quot;SV&quot;,&quot;SZ&quot;,&quot;TC&quot;,&quot;TD&quot;,&quot;TF&quot;,&quot;TG&quot;,&quot;TH&quot;,&quot;TJ&quot;,&quot;TK&quot;,&quot;TL&quot;,&quot;TM&quot;,&quot;TN&quot;,&quot;TO&quot;,&quot;TR&quot;,&quot;TT&quot;,&quot;TV&quot;,&quot;TW&quot;,&quot;TZ&quot;,&quot;UA&quot;,&quot;UG&quot;,&quot;UM&quot;,&quot;US&quot;,&quot;UY&quot;,&quot;UZ&quot;,&quot;VA&quot;,&quot;VC&quot;,&quot;VE&quot;,&quot;VG&quot;,&quot;VI&quot;,&quot;VN&quot;,&quot;VU&quot;,&quot;WF&quot;,&quot;WS&quot;,&quot;YE&quot;,&quot;YT&quot;,&quot;ZA&quot;,&quot;ZM&quot;,&quot;ZW&quot;]">
</div>
</div>
</form>
<head>
<title>NikeStore</title>
</head>
<form id="creditCardForm" method="post" action="/payment/checkout/addNewCard.htm?country=US&amp;view=html&amp;billingCountry=US&amp;langLocale=en_US" novalidate="">
<div id="creditCardFormContainer">
<div class="cardNotification hidden">
<div class="nsg-form--global-message--alert">
......@@ -110,3 +114,4 @@
</div>
</div>
</div>
</form>
<div class="pay_method">
<h3 class="h_check">Pay with Credit Card:</h3>
<head>
<title>Payment Information</title>
</head>
<form name="info" method="post" action="https://www.runningwarehouse.com/finalcheckout.html" id="creditcard">
<div class="pay_method">
<h3 class="h_check">Pay with Credit Card:</h3>
<div class="saved_wrap clearfix">
<div class="saved_wrap clearfix">
</div>
</div>
<div id="fade_card">
<div class="cc_row card_type cf">
<label for="cctype">Card Type:</label>
<div class="cc_selwrap">
<div class="dropdownbox"><div class="current_selection"><span class="selection_text" title="Visa">Visa</span><span class="drop_arrow"><span></span></span></div><ul class="optionslist"><li class="option selected">Visa</li><li class="option">MasterCard</li><li class="option">American Express</li><li class="option">Discover</li></ul></div><select name="ccType" id="cctype" class="fancy_select" style="display: none;">
<option value="VISA" selected="">Visa</option>
<option value="MASTERCARD">MasterCard</option>
<option value="AMEX">American Express</option>
<option value="DISCOVER">Discover</option>
</select>
<div id="fade_card">
<div class="cc_row card_type cf">
<label for="cctype">Card Type:</label>
<div class="cc_selwrap">
<div class="dropdownbox"><div class="current_selection"><span class="selection_text" title="Visa">Visa</span><span class="drop_arrow"><span></span></span></div><ul class="optionslist"><li class="option selected">Visa</li><li class="option">MasterCard</li><li class="option">American Express</li><li class="option">Discover</li></ul></div><select name="ccType" id="cctype" class="fancy_select" style="display: none;">
<option value="VISA" selected="">Visa</option>
<option value="MASTERCARD">MasterCard</option>
<option value="AMEX">American Express</option>
<option value="DISCOVER">Discover</option>
</select>
</div>
<div class="cc_iconwrap">
<span class="cc_icon ic_visa selected">Visa</span>
<span class="cc_icon ic_mc">MasterCard</span>
<span class="cc_icon ic_ae">American Express</span>
<span class="cc_icon ic_disc">Discover</span>
</div>
</div>
<div class="cc_iconwrap">
<span class="cc_icon ic_visa selected">Visa</span>
<span class="cc_icon ic_mc">MasterCard</span>
<span class="cc_icon ic_ae">American Express</span>
<span class="cc_icon ic_disc">Discover</span>
<div class="cc_row cc_num">
<label for="cardnum">Card #:</label>
<input type="text" name="cardnum" id="cardnum" maxlength="19" class="check_text">
</div>
<div class="cc_row">
<label for="expdate">Expire Date:</label>
<input type="text" name="expdate" id="expdate" maxlength="5" class="check_text">
<span>MM/YY</span>
</div>
<div class="cc_row">
<label for="cvv2">CCV2:</label>
<input type="text" name="cvv2" id="cvv2" maxlength="4" class="check_text">
<a href="https://www.runningwarehouse.com/cvv2.html#cvv2_info" class="lightboxpop" data-boxheight="375" data-boxwidth="500">what's this?</a>
</div>
</div>
<div class="cc_row cc_num">
<label for="cardnum">Card #:</label>
<input type="text" name="cardnum" id="cardnum" maxlength="19" class="check_text">
</div>
<div class="cc_row">
<label for="expdate">Expire Date:</label>
<input type="text" name="expdate" id="expdate" maxlength="5" class="check_text">
<span>MM/YY</span>
</div>
<div class="cc_row">
<label for="cvv2">CCV2:</label>
<input type="text" name="cvv2" id="cvv2" maxlength="4" class="check_text">
<a href="https://www.runningwarehouse.com/cvv2.html#cvv2_info" class="lightboxpop" data-boxheight="375" data-boxwidth="500">what's this?</a>
</div>
</div>
</div>
</form>
<head>
<title>Stripe: Checkout</title>
</head>
<form class="checkoutView" method="POST" novalidate="true">
<div class="layoutView paymentView" style="opacity: 1; height: 291px; transition: none; -webkit-transition: none; transform: translateX(0px); overflow: inherit;">
<div class="layoutSubview" style="height: 55px; transform: translateY(0px); opacity: 1; transition: none; -webkit-transition: none;">
<div class="emailInput input">
......@@ -93,3 +97,4 @@
</div>
</div>
</div>
</form>
......@@ -5,5 +5,5 @@ ADDRESS_HOME_CITY | address.city | * City: | | address.name_1-default
ADDRESS_HOME_STATE | address.state | * State: | | address.name_1-default
ADDRESS_HOME_ZIP | address.postalCode | * Zip: | | address.name_1-default
PHONE_HOME_WHOLE_NUMBER | address.phoneNumber | * Phone Number: | | address.name_1-default
UNKNOWN_TYPE | address.rememberedAsBoolean | | true | address.name_1-default
UNKNOWN_TYPE | address.primary | | true | address.name_1-default
UNKNOWN_TYPE | address.rememberedAsBoolean | Save this shipping address for future orders. | true | address.name_1-default
UNKNOWN_TYPE | address.primary | Make this my primary shipping address. | true | address.name_1-default
......@@ -10,3 +10,9 @@ UNKNOWN_TYPE | | Re-enter email | Χ | _1-default
EMAIL_ADDRESS | rEmail_1 | Re-enter email | | _1-default
UNKNOWN_TYPE | | Miles & More number optional | Χ | _1-default
UNKNOWN_TYPE | MamNumber_1 | Miles & More number optional | | _1-default
UNKNOWN_TYPE | | Please select a category | Χ | _1-default
UNKNOWN_TYPE | | Please select a category | ▼ | _1-default
UNKNOWN_TYPE | FlightDate2 | Flight date | | _1-default
UNKNOWN_TYPE | FlightDate | Flight date | | _1-default
UNKNOWN_TYPE | originName | Origin | | _1-default
UNKNOWN_TYPE | destinationName | Destination | | _1-default
......@@ -2,5 +2,5 @@ CREDIT_CARD_TYPE | cardTypeSelect | : | Visa | cardTypeSelect_1-cc
CREDIT_CARD_NUMBER | creditCardNumber | Card Number * | | cardTypeSelect_1-cc
CREDIT_CARD_EXP_MONTH | expirationMonth | Expiry Date * | | cardTypeSelect_1-cc
CREDIT_CARD_EXP_4_DIGIT_YEAR | expirationYear | Expiry Date * | | cardTypeSelect_1-cc
CREDIT_CARD_VERIFICATION_CODE | cvNumber | Where do I find this? | | cardTypeSelect_1-cc
CREDIT_CARD_VERIFICATION_CODE | cvNumber | security code * | | cardTypeSelect_1-cc
PHONE_HOME_WHOLE_NUMBER | phoneNumber | Billing Phone Your registered number with your payment issuer is required to process your order. * | | cardTypeSelect_1-default
CREDIT_CARD_TYPE | ccType | VisaVisaMasterCardAmerican ExpressDiscover | VISA | ccType_1-cc
CREDIT_CARD_TYPE | ccType | Card Type: | VISA | ccType_1-cc
CREDIT_CARD_NUMBER | cardnum | Card #: | | ccType_1-cc
CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR | expdate | Expire Date: | | ccType_1-cc
CREDIT_CARD_VERIFICATION_CODE | cvv2 | CCV2: | | ccType_1-cc
......@@ -27,6 +27,8 @@
'autofill/core/common/autofill_l10n_util.h',
'autofill/core/common/autofill_pref_names.cc',
'autofill/core/common/autofill_pref_names.h',
'autofill/core/common/autofill_regexes.cc',
'autofill/core/common/autofill_regexes.h',
'autofill/core/common/autofill_switches.cc',
'autofill/core/common/autofill_switches.h',
'autofill/core/common/form_data.cc',
......@@ -48,6 +50,9 @@
'autofill/core/common/web_element_descriptor.cc',
'autofill/core/common/web_element_descriptor.h',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],
},
{
......@@ -126,8 +131,6 @@
'autofill/core/browser/autofill_profile.h',
'autofill/core/browser/autofill_regex_constants.cc',
'autofill/core/browser/autofill_regex_constants.h',
'autofill/core/browser/autofill_regexes.cc',
'autofill/core/browser/autofill_regexes.h',
'autofill/core/browser/autofill_scanner.cc',
'autofill/core/browser/autofill_scanner.h',
'autofill/core/browser/autofill_server_field_info.h',
......
......@@ -14,6 +14,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/common/autofill_data_validation.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/form_field_data.h"
......@@ -1161,9 +1162,8 @@ void WebFormControlElementToFormField(const WebFormControlElement& element,
// labels for all form control elements are scraped from the DOM and set in
// WebFormElementToFormData.
field->name = element.nameForAutofill();
field->form_control_type = base::UTF16ToUTF8(element.formControlType());
field->autocomplete_attribute =
base::UTF16ToUTF8(element.getAttribute(kAutocomplete));
field->form_control_type = element.formControlType().utf8();
field->autocomplete_attribute = element.getAttribute(kAutocomplete).utf8();
if (field->autocomplete_attribute.size() > kMaxDataLength) {
// Discard overly long attribute values to avoid DOS-ing the browser
// process. However, send over a default string to indicate that the
......@@ -1286,11 +1286,28 @@ bool UnownedFormElementsAndFieldSetsToFormData(
const std::vector<blink::WebElement>& fieldsets,
const std::vector<blink::WebFormControlElement>& control_elements,
const blink::WebFormControlElement* element,
const GURL& origin,
const blink::WebDocument& document,
ExtractMask extract_mask,
FormData* form,
FormFieldData* field) {
form->origin = origin;
// Only attempt formless Autofill on checkout flows. This avoids the many
// false positives found on the non-checkout web. See http://crbug.com/462375
// For now this early abort only applies to English-language pages, because
// the regex is not translated. Note that an empty "lang" attribute counts as
// English. A potential problem is that this only checks document.title(), but
// should actually check the main frame's title. Thus it may make bad
// decisions for iframes.
WebElement html_element = document.documentElement();
std::string lang;
if (!html_element.isNull())
lang = html_element.getAttribute("lang").utf8();
if ((lang.empty() || StartsWithASCII(lang, "en", false)) &&
!MatchesPattern(document.title(),
base::UTF8ToUTF16("payment|checkout|address|delivery|shipping"))) {
return false;
}
form->origin = document.url();
form->user_submitted = false;
form->is_form_tag = false;
......@@ -1314,7 +1331,7 @@ bool FindFormAndFieldForFormControlElement(const WebFormControlElement& element,
std::vector<WebFormControlElement> control_elements =
GetUnownedAutofillableFormFieldElements(document.all(), &fieldsets);
return UnownedFormElementsAndFieldSetsToFormData(
fieldsets, control_elements, &element, document.url(), extract_mask,
fieldsets, control_elements, &element, document, extract_mask,
form, field);
}
......
......@@ -122,7 +122,7 @@ bool UnownedFormElementsAndFieldSetsToFormData(
const std::vector<blink::WebElement>& fieldsets,
const std::vector<blink::WebFormControlElement>& control_elements,
const blink::WebFormControlElement* element,
const GURL& origin,
const blink::WebDocument& document,
ExtractMask extract_mask,
FormData* form,
FormFieldData* field);
......
......@@ -133,7 +133,7 @@ std::vector<FormData> FormCache::ExtractNewForms() {
FormData synthetic_form;
if (!UnownedFormElementsAndFieldSetsToFormData(
fieldsets, control_elements, nullptr, document.url(), extract_mask,
fieldsets, control_elements, nullptr, document, extract_mask,
&synthetic_form, nullptr)) {
return forms;
}
......
......@@ -42,8 +42,6 @@ static_library("browser") {
"autofill_profile.h",
"autofill_regex_constants.cc",
"autofill_regex_constants.h",
"autofill_regexes.cc",
"autofill_regexes.h",
"autofill_scanner.cc",
"autofill_scanner.h",
"autofill_server_field_info.h",
......@@ -207,7 +205,6 @@ source_set("unit_tests") {
"autofill_merge_unittest.cc",
"autofill_metrics_unittest.cc",
"autofill_profile_unittest.cc",
"autofill_regexes_unittest.cc",
"autofill_type_unittest.cc",
"autofill_xml_parser_unittest.cc",
"contact_info_unittest.cc",
......
......@@ -20,10 +20,10 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/autofill_l10n_util.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "components/autofill/core/common/form_field_data.h"
#include "grit/components_scaled_resources.h"
#include "grit/components_strings.h"
......
......@@ -15,9 +15,9 @@
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_regex_constants.h"
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/browser/autofill_scanner.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
......
......@@ -15,13 +15,13 @@
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/address_field.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/browser/autofill_scanner.h"
#include "components/autofill/core/browser/credit_card_field.h"
#include "components/autofill/core/browser/email_field.h"
#include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/browser/name_field.h"
#include "components/autofill/core/browser/phone_field.h"
#include "components/autofill/core/common/autofill_regexes.h"
namespace autofill {
namespace {
......
......@@ -9,10 +9,9 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/state_names.h"
#include "components/autofill/core/common/autofill_regexes.h"
namespace autofill {
......
......@@ -12,6 +12,8 @@ static_library("common") {
"autofill_l10n_util.h",
"autofill_pref_names.cc",
"autofill_pref_names.h",
"autofill_regexes.cc",
"autofill_regexes.h",
"autofill_switches.cc",
"autofill_switches.h",
"form_data.cc",
......@@ -45,11 +47,14 @@ static_library("common") {
if (is_android) {
# deps += [ 'autofill_jni_headers' ] TODO(GYP)
}
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}
source_set("unit_tests") {
testonly = true
sources = [
"autofill_regexes_unittest.cc",
"form_data_unittest.cc",
"form_field_data_unittest.cc",
"password_form_fill_data_unittest.cc",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/logging.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_REGEXES_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_REGEXES_H_
#ifndef COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_REGEXES_H_
#define COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_REGEXES_H_
#include "base/strings/string16.h"
......@@ -17,4 +17,4 @@ bool MatchesPattern(const base::string16& input,
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_REGEXES_H_
#endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_REGEXES_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/common/autofill_regexes.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
......
......@@ -41,7 +41,6 @@
'autofill/core/browser/autofill_merge_unittest.cc',
'autofill/core/browser/autofill_metrics_unittest.cc',
'autofill/core/browser/autofill_profile_unittest.cc',
'autofill/core/browser/autofill_regexes_unittest.cc',
'autofill/core/browser/autofill_type_unittest.cc',
'autofill/core/browser/autofill_xml_parser_unittest.cc',
'autofill/core/browser/contact_info_unittest.cc',
......@@ -59,6 +58,7 @@
'autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc',
'autofill/core/browser/webdata/autofill_table_unittest.cc',
'autofill/core/browser/webdata/web_data_service_unittest.cc',
'autofill/core/common/autofill_regexes_unittest.cc',
'autofill/core/common/form_data_unittest.cc',
'autofill/core/common/form_field_data_unittest.cc',
'autofill/core/common/password_form_fill_data_unittest.cc',
......
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