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

Unified Diff: chrome/browser/autofill/address_field.cc

Issue 4249002: AutoFill: Fix two heuristic issues with nrm.org. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 | « chrome/browser/autofill/address_field.h ('k') | chrome/browser/autofill/address_field_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/address_field.cc
diff --git a/chrome/browser/autofill/address_field.cc b/chrome/browser/autofill/address_field.cc
index 52e5193609fe0e2111d481c026bcdf8a9af8e783..41a1a1dc3baf7b6583e1f5073623a6aeb2b602e3 100644
--- a/chrome/browser/autofill/address_field.cc
+++ b/chrome/browser/autofill/address_field.cc
@@ -91,12 +91,10 @@ AddressField* AddressField::Parse(
if (ParseCompany(&q, is_ecml, address_field.get()) ||
ParseAddressLines(&q, is_ecml, address_field.get()) ||
ParseCity(&q, is_ecml, address_field.get()) ||
+ ParseState(&q, is_ecml, address_field.get()) ||
ParseZipCode(&q, is_ecml, address_field.get()) ||
ParseCountry(&q, is_ecml, address_field.get())) {
continue;
- } else if ((!address_field->state_ || address_field->state_->IsEmpty()) &&
- address_field->ParseState(&q, is_ecml, address_field.get())) {
- continue;
} else if (ParseText(&q, ASCIIToUTF16("attention|attn.")) ||
ParseText(&q, ASCIIToUTF16("province|region|other"))) {
// We ignore the following:
@@ -339,9 +337,13 @@ bool AddressField::ParseCity(
return true;
}
+// static
bool AddressField::ParseState(
std::vector<AutoFillField*>::const_iterator* iter,
bool is_ecml, AddressField* address_field) {
+ if (address_field->state_)
Ilya Sherman 2010/11/02 15:35:08 nit: Do we not want "&& !address_field->state_->Is
James Hawkins 2010/11/02 17:32:14 No. I don't know why it was written in the first p
+ return false;
+
string16 pattern;
if (is_ecml)
pattern = GetEcmlPattern(kEcmlShipToStateProv, kEcmlBillToStateProv, '|');
« no previous file with comments | « chrome/browser/autofill/address_field.h ('k') | chrome/browser/autofill/address_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698