| Index: components/autofill/core/browser/name_field.cc
|
| diff --git a/components/autofill/core/browser/name_field.cc b/components/autofill/core/browser/name_field.cc
|
| index e1e093462de5dd11ef75e3bc49516602c5e5402d..8532de13c3a1b1f7bd25d04c3a3b90fdd7856a2a 100644
|
| --- a/components/autofill/core/browser/name_field.cc
|
| +++ b/components/autofill/core/browser/name_field.cc
|
| @@ -6,9 +6,12 @@
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/strings/string_util.h"
|
| +#include "base/strings/utf_string_conversions.h"
|
| #include "components/autofill/core/browser/autofill_regex_constants.h"
|
| #include "components/autofill/core/browser/autofill_scanner.h"
|
| #include "components/autofill/core/browser/autofill_type.h"
|
| +
|
| +using base::UTF8ToUTF16;
|
|
|
| namespace autofill {
|
| namespace {
|
| @@ -77,7 +80,7 @@
|
| scoped_ptr<FullNameField> FullNameField::Parse(AutofillScanner* scanner) {
|
| // Exclude e.g. "username" or "nickname" fields.
|
| scanner->SaveCursor();
|
| - bool should_ignore = ParseField(scanner, kNameIgnoredRe, NULL);
|
| + bool should_ignore = ParseField(scanner, UTF8ToUTF16(kNameIgnoredRe), NULL);
|
| scanner->Rewind();
|
| if (should_ignore)
|
| return NULL;
|
| @@ -86,7 +89,7 @@
|
| // for example, Travelocity_Edit travel profile.html contains a field
|
| // "Travel Profile Name".
|
| AutofillField* field = NULL;
|
| - if (ParseField(scanner, kNameRe, &field))
|
| + if (ParseField(scanner, UTF8ToUTF16(kNameRe), &field))
|
| return make_scoped_ptr(new FullNameField(field));
|
|
|
| return NULL;
|
| @@ -107,7 +110,7 @@
|
| scanner->SaveCursor();
|
|
|
| AutofillField* next = NULL;
|
| - if (ParseField(scanner, kNameSpecificRe, &v->first_name_) &&
|
| + if (ParseField(scanner, UTF8ToUTF16(kNameSpecificRe), &v->first_name_) &&
|
| ParseEmptyLabel(scanner, &next)) {
|
| if (ParseEmptyLabel(scanner, &v->last_name_)) {
|
| // There are three name fields; assume that the middle one is a
|
| @@ -144,12 +147,13 @@
|
| // Allow name fields to appear in any order.
|
| while (!scanner->IsEnd()) {
|
| // Skip over any unrelated fields, e.g. "username" or "nickname".
|
| - if (ParseFieldSpecifics(scanner, kNameIgnoredRe,
|
| + if (ParseFieldSpecifics(scanner, UTF8ToUTF16(kNameIgnoredRe),
|
| MATCH_DEFAULT | MATCH_SELECT, NULL)) {
|
| continue;
|
| }
|
|
|
| - if (!v->first_name_ && ParseField(scanner, kFirstNameRe, &v->first_name_)) {
|
| + if (!v->first_name_ &&
|
| + ParseField(scanner, UTF8ToUTF16(kFirstNameRe), &v->first_name_)) {
|
| continue;
|
| }
|
|
|
| @@ -159,17 +163,18 @@
|
| // "txtmiddlename"); such a field probably actually represents a
|
| // middle initial.
|
| if (!v->middle_name_ &&
|
| - ParseField(scanner, kMiddleInitialRe, &v->middle_name_)) {
|
| + ParseField(scanner, UTF8ToUTF16(kMiddleInitialRe), &v->middle_name_)) {
|
| v->middle_initial_ = true;
|
| continue;
|
| }
|
|
|
| if (!v->middle_name_ &&
|
| - ParseField(scanner, kMiddleNameRe, &v->middle_name_)) {
|
| - continue;
|
| - }
|
| -
|
| - if (!v->last_name_ && ParseField(scanner, kLastNameRe, &v->last_name_)) {
|
| + ParseField(scanner, UTF8ToUTF16(kMiddleNameRe), &v->middle_name_)) {
|
| + continue;
|
| + }
|
| +
|
| + if (!v->last_name_ &&
|
| + ParseField(scanner, UTF8ToUTF16(kLastNameRe), &v->last_name_)) {
|
| continue;
|
| }
|
|
|
|
|