| 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/contact_info.h" | 5 #include "chrome/browser/autofill/contact_info.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/autofill/autofill_type.h" | 10 #include "chrome/browser/autofill/autofill_type.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 return email(); | 128 return email(); |
| 129 | 129 |
| 130 if (field_type == COMPANY_NAME) | 130 if (field_type == COMPANY_NAME) |
| 131 return company_name(); | 131 return company_name(); |
| 132 | 132 |
| 133 return string16(); | 133 return string16(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ContactInfo::SetInfo(const AutoFillType& type, const string16& value) { | 136 void ContactInfo::SetInfo(const AutoFillType& type, const string16& value) { |
| 137 AutoFillFieldType field_type = type.field_type(); | 137 AutoFillFieldType field_type = type.field_type(); |
| 138 DCHECK(type.group() == AutoFillType::CONTACT_INFO); | 138 DCHECK_EQ(type.group(), AutoFillType::CONTACT_INFO); |
| 139 if (field_type == NAME_FIRST) | 139 if (field_type == NAME_FIRST) |
| 140 SetFirst(value); | 140 SetFirst(value); |
| 141 else if (field_type == NAME_MIDDLE || field_type == NAME_MIDDLE_INITIAL) | 141 else if (field_type == NAME_MIDDLE || field_type == NAME_MIDDLE_INITIAL) |
| 142 SetMiddle(value); | 142 SetMiddle(value); |
| 143 else if (field_type == NAME_LAST) | 143 else if (field_type == NAME_LAST) |
| 144 SetLast(value); | 144 SetLast(value); |
| 145 else if (field_type == NAME_SUFFIX) | 145 else if (field_type == NAME_SUFFIX) |
| 146 set_suffix(value); | 146 set_suffix(value); |
| 147 else if (field_type == EMAIL_ADDRESS) | 147 else if (field_type == EMAIL_ADDRESS) |
| 148 email_ = value; | 148 email_ = value; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 SetLast(full_name_tokens.back()); | 408 SetLast(full_name_tokens.back()); |
| 409 if (full_name_tokens.size() > 2) { | 409 if (full_name_tokens.size() > 2) { |
| 410 full_name_tokens.erase(full_name_tokens.begin()); | 410 full_name_tokens.erase(full_name_tokens.begin()); |
| 411 full_name_tokens.pop_back(); | 411 full_name_tokens.pop_back(); |
| 412 SetMiddle(JoinString(full_name_tokens, ' ')); | 412 SetMiddle(JoinString(full_name_tokens, ' ')); |
| 413 } | 413 } |
| 414 } | 414 } |
| 415 } | 415 } |
| 416 } | 416 } |
| 417 | 417 |
| OLD | NEW |