| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/autofill/email_field.h" | |
| 6 | |
| 7 #include "base/utf_string_conversions.h" | |
| 8 #include "chrome/browser/autofill/autofill_regex_constants.h" | |
| 9 #include "chrome/browser/autofill/autofill_scanner.h" | |
| 10 #include "ui/base/l10n/l10n_util.h" | |
| 11 | |
| 12 // static | |
| 13 FormField* EmailField::Parse(AutofillScanner* scanner) { | |
| 14 const AutofillField* field; | |
| 15 if (ParseFieldSpecifics(scanner, UTF8ToUTF16(autofill::kEmailRe), | |
| 16 MATCH_DEFAULT | MATCH_EMAIL, &field)) { | |
| 17 return new EmailField(field); | |
| 18 } | |
| 19 | |
| 20 return NULL; | |
| 21 } | |
| 22 | |
| 23 EmailField::EmailField(const AutofillField* field) : field_(field) { | |
| 24 } | |
| 25 | |
| 26 bool EmailField::ClassifyField(FieldTypeMap* map) const { | |
| 27 return AddClassification(field_, EMAIL_ADDRESS, map); | |
| 28 } | |
| OLD | NEW |