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

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

Issue 1801002: AutoFill: Notify the renderer when the page has finished translating. Extract (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Update comment. Created 10 years, 8 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 | « no previous file | chrome/browser/autofill/name_field_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/name_field.cc
diff --git a/chrome/browser/autofill/name_field.cc b/chrome/browser/autofill/name_field.cc
index e04b4c343538003ed8e0634ff97bad39995d4419..7d870302a55db9ff1ad31feef205eb42c163cd81 100644
--- a/chrome/browser/autofill/name_field.cc
+++ b/chrome/browser/autofill/name_field.cc
@@ -74,9 +74,9 @@ FirstLastNameField* FirstLastNameField::Parse2(
// so we match "initials" here (and just fill in a first name there,
// American-style).
// The ".*first$" matches fields ending in "first" (example in sample8.html).
- if (!ParseText(&q,
- ASCIIToUTF16("first name|firstname|initials|fname|.*first$"),
- &v.first_name_))
+ string16 match =
+ ASCIIToUTF16("first name|first_name|firstname|initials|fname|.*first$");
+ if (!ParseText(&q, match, &v.first_name_))
return NULL;
// We check for a middle initial before checking for a middle name
@@ -84,19 +84,17 @@ FirstLastNameField* FirstLastNameField::Parse2(
// as both (the label text is "MI" and the element name is
// "txtmiddlename"); such a field probably actually represents a
// middle initial.
- if (ParseText(&q,
- ASCIIToUTF16("^mi$|middle initial|middleinitial|m.i."),
- &v.middle_name_)) {
+ match = ASCIIToUTF16("^mi$|middle initial|middleinitial|m.i.");
+ if (ParseText(&q, match, &v.middle_name_)) {
v.middle_initial_ = true;
} else {
- ParseText(
- &q, ASCIIToUTF16("middle name|mname|middlename"), &v.middle_name_);
+ match = ASCIIToUTF16("middle name|mname|middlename");
+ ParseText(&q, match, &v.middle_name_);
}
// The ".*last$" matches fields ending in "last" (example in sample8.html).
- if (!ParseText(&q,
- ASCIIToUTF16("last name|lastname|lname|surname|.*last$"),
- &v.last_name_))
+ match = ASCIIToUTF16("last name|last_name|lastname|lname|surname|.*last$");
+ if (!ParseText(&q, match, &v.last_name_))
return NULL;
*iter = q;
« no previous file with comments | « no previous file | chrome/browser/autofill/name_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698