OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/core/browser/contact_info.h" | 5 #include "components/autofill/core/browser/contact_info.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... | |
27 NameInfo& NameInfo::operator=(const NameInfo& info) { | 27 NameInfo& NameInfo::operator=(const NameInfo& info) { |
28 if (this == &info) | 28 if (this == &info) |
29 return *this; | 29 return *this; |
30 | 30 |
31 first_ = info.first_; | 31 first_ = info.first_; |
32 middle_ = info.middle_; | 32 middle_ = info.middle_; |
33 last_ = info.last_; | 33 last_ = info.last_; |
34 return *this; | 34 return *this; |
35 } | 35 } |
36 | 36 |
37 bool NameInfo::operator==(const NameInfo& info) { | |
38 return (StringToLowerASCII(first_) == StringToLowerASCII(info.first_) && | |
39 StringToLowerASCII(middle_) == StringToLowerASCII(info.middle_) && | |
40 StringToLowerASCII(last_) == StringToLowerASCII(info.last_)); | |
Ilya Sherman
2014/06/12 22:35:11
operator== should be case-sensitive. If you want
Pritam Nikam
2014/06/13 14:03:33
Done.
| |
41 } | |
42 | |
43 bool NameInfo::operator!=(const NameInfo& info) { | |
44 return !(*this == info); | |
45 } | |
46 | |
37 void NameInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const { | 47 void NameInfo::GetSupportedTypes(ServerFieldTypeSet* supported_types) const { |
38 supported_types->insert(NAME_FIRST); | 48 supported_types->insert(NAME_FIRST); |
39 supported_types->insert(NAME_MIDDLE); | 49 supported_types->insert(NAME_MIDDLE); |
40 supported_types->insert(NAME_LAST); | 50 supported_types->insert(NAME_LAST); |
41 supported_types->insert(NAME_MIDDLE_INITIAL); | 51 supported_types->insert(NAME_MIDDLE_INITIAL); |
42 supported_types->insert(NAME_FULL); | 52 supported_types->insert(NAME_FULL); |
43 } | 53 } |
44 | 54 |
45 base::string16 NameInfo::GetRawInfo(ServerFieldType type) const { | 55 base::string16 NameInfo::GetRawInfo(ServerFieldType type) const { |
46 DCHECK_EQ(NAME, AutofillType(type).group()); | 56 DCHECK_EQ(NAME, AutofillType(type).group()); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 return base::string16(); | 207 return base::string16(); |
198 } | 208 } |
199 | 209 |
200 void CompanyInfo::SetRawInfo(ServerFieldType type, | 210 void CompanyInfo::SetRawInfo(ServerFieldType type, |
201 const base::string16& value) { | 211 const base::string16& value) { |
202 DCHECK_EQ(COMPANY_NAME, type); | 212 DCHECK_EQ(COMPANY_NAME, type); |
203 company_name_ = value; | 213 company_name_ = value; |
204 } | 214 } |
205 | 215 |
206 } // namespace autofill | 216 } // namespace autofill |
OLD | NEW |