| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/autofill/fax_field.h" | 5 #include "chrome/browser/autofill/fax_field.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" |
| 7 #include "base/logging.h" | 8 #include "base/logging.h" |
| 8 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/autofill/autofill_field.h" | 11 #include "chrome/browser/autofill/autofill_field.h" |
| 12 #include "grit/autofill_resources.h" |
| 11 | 13 |
| 12 // static | 14 // static |
| 13 FaxField* FaxField::Parse(std::vector<AutoFillField*>::const_iterator* iter) { | 15 FaxField* FaxField::Parse(std::vector<AutoFillField*>::const_iterator* iter) { |
| 14 DCHECK(iter); | 16 DCHECK(iter); |
| 15 | 17 |
| 16 scoped_ptr<FaxField> fax_field(new FaxField); | 18 scoped_ptr<FaxField> fax_field(new FaxField); |
| 17 if (ParseText(iter, ASCIIToUTF16("fax"), &fax_field->number_)) | 19 if (ParseText(iter, |
| 20 l10n_util::GetStringUTF16(IDS_AUTOFILL_FAX_RE), |
| 21 &fax_field->number_)) { |
| 18 return fax_field.release(); | 22 return fax_field.release(); |
| 23 } |
| 19 | 24 |
| 20 return NULL; | 25 return NULL; |
| 21 } | 26 } |
| 22 | 27 |
| 23 bool FaxField::GetFieldInfo(FieldTypeMap* field_type_map) const { | 28 bool FaxField::GetFieldInfo(FieldTypeMap* field_type_map) const { |
| 24 return Add(field_type_map, number_, AutoFillType(PHONE_FAX_WHOLE_NUMBER)); | 29 return Add(field_type_map, number_, AutoFillType(PHONE_FAX_WHOLE_NUMBER)); |
| 25 } | 30 } |
| 26 | 31 |
| 27 FaxField::FaxField() : number_(NULL) {} | 32 FaxField::FaxField() : number_(NULL) {} |
| OLD | NEW |