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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // FormGroup: | 30 // FormGroup: |
31 virtual base::string16 GetRawInfo(ServerFieldType type) const OVERRIDE; | 31 virtual base::string16 GetRawInfo(ServerFieldType type) const OVERRIDE; |
32 virtual void SetRawInfo(ServerFieldType type, | 32 virtual void SetRawInfo(ServerFieldType type, |
33 const base::string16& value) OVERRIDE; | 33 const base::string16& value) OVERRIDE; |
34 | 34 |
35 private: | 35 private: |
36 // FormGroup: | 36 // FormGroup: |
37 virtual void GetSupportedTypes( | 37 virtual void GetSupportedTypes( |
38 ServerFieldTypeSet* supported_types) const OVERRIDE; | 38 ServerFieldTypeSet* supported_types) const OVERRIDE; |
39 | 39 |
40 // Returns the full name, which can include up to the first, middle, and last | 40 // Returns the full name, which is either |full_|, or if |full_| is empty, |
41 // name. | 41 // is composed of given, middle and family. |
42 base::string16 FullName() const; | 42 base::string16 FullName() const; |
43 | 43 |
44 // Returns the middle initial if |middle_| is non-empty. Returns an empty | 44 // Returns the middle initial if |middle_| is non-empty. Returns an empty |
45 // string otherwise. | 45 // string otherwise. |
46 base::string16 MiddleInitial() const; | 46 base::string16 MiddleInitial() const; |
47 | 47 |
48 const base::string16& first() const { return first_; } | 48 // Sets |given_|, |middle_|, and |family_| to the tokenized |full|. |
49 const base::string16& middle() const { return middle_; } | |
50 const base::string16& last() const { return last_; } | |
51 | |
52 // Sets |first_|, |middle_|, and |last_| to the tokenized |full|. | |
53 // It is tokenized on a space only. | |
54 void SetFullName(const base::string16& full); | 49 void SetFullName(const base::string16& full); |
55 | 50 |
56 base::string16 first_; | 51 base::string16 given_; |
57 base::string16 middle_; | 52 base::string16 middle_; |
58 base::string16 last_; | 53 base::string16 family_; |
| 54 base::string16 full_; |
59 }; | 55 }; |
60 | 56 |
61 class EmailInfo : public FormGroup { | 57 class EmailInfo : public FormGroup { |
62 public: | 58 public: |
63 EmailInfo(); | 59 EmailInfo(); |
64 EmailInfo(const EmailInfo& info); | 60 EmailInfo(const EmailInfo& info); |
65 virtual ~EmailInfo(); | 61 virtual ~EmailInfo(); |
66 | 62 |
67 EmailInfo& operator=(const EmailInfo& info); | 63 EmailInfo& operator=(const EmailInfo& info); |
68 | 64 |
(...skipping 27 matching lines...) Expand all Loading... |
96 // FormGroup: | 92 // FormGroup: |
97 virtual void GetSupportedTypes( | 93 virtual void GetSupportedTypes( |
98 ServerFieldTypeSet* supported_types) const OVERRIDE; | 94 ServerFieldTypeSet* supported_types) const OVERRIDE; |
99 | 95 |
100 base::string16 company_name_; | 96 base::string16 company_name_; |
101 }; | 97 }; |
102 | 98 |
103 } // namespace autofill | 99 } // namespace autofill |
104 | 100 |
105 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ | 101 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ |
OLD | NEW |