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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autofill/autofill_field.h" | 10 #include "chrome/browser/autofill/autofill_field.h" |
10 | 11 |
11 // static | 12 // static |
12 FaxField* FaxField::Parse(std::vector<AutoFillField*>::const_iterator* iter) { | 13 FaxField* FaxField::Parse(std::vector<AutoFillField*>::const_iterator* iter) { |
13 DCHECK(iter); | 14 DCHECK(iter); |
14 | 15 |
15 scoped_ptr<FaxField> fax_field(new FaxField); | 16 scoped_ptr<FaxField> fax_field(new FaxField); |
16 if (ParseText(iter, ASCIIToUTF16("fax"), &fax_field->number_)) | 17 if (ParseText(iter, ASCIIToUTF16("fax"), &fax_field->number_)) |
17 return fax_field.release(); | 18 return fax_field.release(); |
18 | 19 |
19 return NULL; | 20 return NULL; |
20 } | 21 } |
21 | 22 |
22 bool FaxField::GetFieldInfo(FieldTypeMap* field_type_map) const { | 23 bool FaxField::GetFieldInfo(FieldTypeMap* field_type_map) const { |
23 return Add(field_type_map, number_, AutoFillType(PHONE_FAX_WHOLE_NUMBER)); | 24 return Add(field_type_map, number_, AutoFillType(PHONE_FAX_WHOLE_NUMBER)); |
24 } | 25 } |
25 | 26 |
26 FaxField::FaxField() : number_(NULL) {} | 27 FaxField::FaxField() : number_(NULL) {} |
OLD | NEW |