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

Side by Side Diff: components/autofill/core/browser/validation.cc

Issue 1106313002: Revert of Limit form-less Autofilling to pages that look like checkout pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 #include "components/autofill/core/browser/validation.h" 5 #include "components/autofill/core/browser/validation.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "components/autofill/core/browser/autofill_regexes.h"
12 #include "components/autofill/core/browser/credit_card.h" 13 #include "components/autofill/core/browser/credit_card.h"
13 #include "components/autofill/core/browser/state_names.h" 14 #include "components/autofill/core/browser/state_names.h"
14 #include "components/autofill/core/common/autofill_regexes.h" 15
15 16
16 namespace autofill { 17 namespace autofill {
17 18
18 bool IsValidCreditCardExpirationDate(const base::string16& year, 19 bool IsValidCreditCardExpirationDate(const base::string16& year,
19 const base::string16& month, 20 const base::string16& month,
20 const base::Time& now) { 21 const base::Time& now) {
21 base::string16 year_cleaned, month_cleaned; 22 base::string16 year_cleaned, month_cleaned;
22 base::TrimWhitespace(year, base::TRIM_ALL, &year_cleaned); 23 base::TrimWhitespace(year, base::TRIM_ALL, &year_cleaned);
23 base::TrimWhitespace(month, base::TRIM_ALL, &month_cleaned); 24 base::TrimWhitespace(month, base::TRIM_ALL, &month_cleaned);
24 if (year_cleaned.length() != 4) 25 if (year_cleaned.length() != 4)
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 number_string.begin() + 9), 202 number_string.begin() + 9),
202 &serial) 203 &serial)
203 || serial == 0) { 204 || serial == 0) {
204 return false; 205 return false;
205 } 206 }
206 207
207 return true; 208 return true;
208 } 209 }
209 210
210 } // namespace autofill 211 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/form_field.cc ('k') | components/autofill/core/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698