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

Side by Side Diff: components/autofill/core/browser/autofill_regex_constants.cc.utf8

Issue 1001193002: Autofill: Better recognize credit card fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains UTF8 strings that we want as char arrays. To avoid 5 // This file contains UTF8 strings that we want as char arrays. To avoid
6 // different compilers, we use a script to convert the UTF8 strings into 6 // different compilers, we use a script to convert the UTF8 strings into
7 // numeric literals (\x##). 7 // numeric literals (\x##).
8 8
9 #include "components/autofill/core/browser/autofill_regex_constants.h" 9 #include "components/autofill/core/browser/autofill_regex_constants.h"
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 "|numéro" // fr-FR 142 "|numéro" // fr-FR
143 "|カード番号" // ja-JP 143 "|カード番号" // ja-JP
144 "|Номер.*карты" // ru 144 "|Номер.*карты" // ru
145 "|信用卡号|信用卡号码" // zh-CN 145 "|信用卡号|信用卡号码" // zh-CN
146 "|信用卡卡號" // zh-TW 146 "|信用卡卡號" // zh-TW
147 "|카드"; // ko-KR 147 "|카드"; // ko-KR
148 const char kCardCvcRe[] = 148 const char kCardCvcRe[] =
149 "verification|card identification|security code|card code" 149 "verification|card identification|security code|card code"
150 "|cvn|cvv|cvc|csc|cvd|cid" 150 "|cvn|cvv|cvc|csc|cvd|cid"
151 "|\\bcid\\b"; 151 "|\\bcid\\b";
152 const char kCardTypeRe[] =
153 "(card|cc|payment).?type|payment.?method|card.*brand";
154 152
155 // "Expiration date" is the most common label here, but some pages have 153 // "Expiration date" is the most common label here, but some pages have
156 // "Expires", "exp. date" or "exp. month" and "exp. year". We also look 154 // "Expires", "exp. date" or "exp. month" and "exp. year". We also look
157 // for the field names ccmonth and ccyear, which appear on at least 4 of 155 // for the field names ccmonth and ccyear, which appear on at least 4 of
158 // our test pages. 156 // our test pages.
159 157
160 // On at least one page (The China Shop2.html) we find only the labels 158 // On at least one page (The China Shop2.html) we find only the labels
161 // "month" and "year". So for now we match these words directly; we'll 159 // "month" and "year". So for now we match these words directly; we'll
162 // see if this turns out to be too general. 160 // see if this turns out to be too general.
163 161
(...skipping 26 matching lines...) Expand all
190 "exp.*date.*[^y]yy([^y]|$)"; 188 "exp.*date.*[^y]yy([^y]|$)";
191 const char kExpirationDateRe[] = 189 const char kExpirationDateRe[] =
192 "expir|exp.*date" 190 "expir|exp.*date"
193 "|gueltig|gültig" // de-DE 191 "|gueltig|gültig" // de-DE
194 "|fecha" // es 192 "|fecha" // es
195 "|date.*exp" // fr-FR 193 "|date.*exp" // fr-FR
196 "|scadenza" // it-IT 194 "|scadenza" // it-IT
197 "|有効期限" // ja-JP 195 "|有効期限" // ja-JP
198 "|validade" // pt-BR, pt-PT 196 "|validade" // pt-BR, pt-PT
199 "|Срок действия карты"; // ru 197 "|Срок действия карты"; // ru
200 const char kCardIgnoredRe[] =
201 "^card";
202 const char kGiftCardRe[] = 198 const char kGiftCardRe[] =
203 "gift.?card"; 199 "gift.?card";
204 200
205 201
206 ///////////////////////////////////////////////////////////////////////////// 202 /////////////////////////////////////////////////////////////////////////////
207 // email_field.cc 203 // email_field.cc
208 ///////////////////////////////////////////////////////////////////////////// 204 /////////////////////////////////////////////////////////////////////////////
209 const char kEmailRe[] = 205 const char kEmailRe[] =
210 "e.?mail" 206 "e.?mail"
211 "|courriel" // fr 207 "|courriel" // fr
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 "prefix|exchange" 285 "prefix|exchange"
290 "|preselection" // fr-FR 286 "|preselection" // fr-FR
291 "|ddd"; // pt-BR, pt-PT 287 "|ddd"; // pt-BR, pt-PT
292 const char kPhoneSuffixRe[] = 288 const char kPhoneSuffixRe[] =
293 "suffix"; 289 "suffix";
294 const char kPhoneExtensionRe[] = 290 const char kPhoneExtensionRe[] =
295 "\\bext|ext\\b|extension" 291 "\\bext|ext\\b|extension"
296 "|ramal"; // pt-BR, pt-PT 292 "|ramal"; // pt-BR, pt-PT
297 293
298 } // namespace autofill 294 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_regex_constants.h ('k') | components/autofill/core/browser/credit_card_field.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698