| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/autofill_field.h" | 5 #include "chrome/browser/autofill/autofill_field.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/sha1.h" | 8 #include "base/sha1.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 AutofillField::AutofillField() | 28 AutofillField::AutofillField() |
| 29 : server_type_(NO_SERVER_DATA), | 29 : server_type_(NO_SERVER_DATA), |
| 30 heuristic_type_(UNKNOWN_TYPE), | 30 heuristic_type_(UNKNOWN_TYPE), |
| 31 phone_part_(IGNORED) { | 31 phone_part_(IGNORED) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 AutofillField::AutofillField(const webkit::forms::FormField& field, | 34 AutofillField::AutofillField(const chrome::FormField& field, |
| 35 const string16& unique_name) | 35 const string16& unique_name) |
| 36 : webkit::forms::FormField(field), | 36 : chrome::FormField(field), |
| 37 unique_name_(unique_name), | 37 unique_name_(unique_name), |
| 38 server_type_(NO_SERVER_DATA), | 38 server_type_(NO_SERVER_DATA), |
| 39 heuristic_type_(UNKNOWN_TYPE), | 39 heuristic_type_(UNKNOWN_TYPE), |
| 40 phone_part_(IGNORED) { | 40 phone_part_(IGNORED) { |
| 41 } | 41 } |
| 42 | 42 |
| 43 AutofillField::~AutofillField() {} | 43 AutofillField::~AutofillField() {} |
| 44 | 44 |
| 45 void AutofillField::set_heuristic_type(AutofillFieldType type) { | 45 void AutofillField::set_heuristic_type(AutofillFieldType type) { |
| 46 if (type >= 0 && type < MAX_VALID_FIELD_TYPE) { | 46 if (type >= 0 && type < MAX_VALID_FIELD_TYPE) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 std::string AutofillField::FieldSignature() const { | 75 std::string AutofillField::FieldSignature() const { |
| 76 std::string field_name = UTF16ToUTF8(name); | 76 std::string field_name = UTF16ToUTF8(name); |
| 77 std::string type = UTF16ToUTF8(form_control_type); | 77 std::string type = UTF16ToUTF8(form_control_type); |
| 78 std::string field_string = field_name + "&" + type; | 78 std::string field_string = field_name + "&" + type; |
| 79 return Hash32Bit(field_string); | 79 return Hash32Bit(field_string); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool AutofillField::IsFieldFillable() const { | 82 bool AutofillField::IsFieldFillable() const { |
| 83 return type() != UNKNOWN_TYPE; | 83 return type() != UNKNOWN_TYPE; |
| 84 } | 84 } |
| OLD | NEW |