| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 AutofillFieldType AutofillField::type() const { | 54 AutofillFieldType AutofillField::type() const { |
| 55 if (server_type_ != NO_SERVER_DATA) | 55 if (server_type_ != NO_SERVER_DATA) |
| 56 return server_type_; | 56 return server_type_; |
| 57 | 57 |
| 58 return heuristic_type_; | 58 return heuristic_type_; |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool AutofillField::IsEmpty() const { | 61 bool AutofillField::IsEmpty() const { |
| 62 return value().empty(); | 62 return value.empty(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 std::string AutofillField::FieldSignature() const { | 65 std::string AutofillField::FieldSignature() const { |
| 66 std::string field_name = UTF16ToUTF8(name()); | 66 std::string field_name = UTF16ToUTF8(name); |
| 67 std::string type = UTF16ToUTF8(form_control_type()); | 67 std::string type = UTF16ToUTF8(form_control_type); |
| 68 std::string field_string = field_name + "&" + type; | 68 std::string field_string = field_name + "&" + type; |
| 69 return Hash32Bit(field_string); | 69 return Hash32Bit(field_string); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool AutofillField::IsFieldFillable() const { | 72 bool AutofillField::IsFieldFillable() const { |
| 73 return type() != UNKNOWN_TYPE; | 73 return type() != UNKNOWN_TYPE; |
| 74 } | 74 } |
| OLD | NEW |