| 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 #ifndef CHROME_BROWSER_AUTOFILL_CONTACT_INFO_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_CONTACT_INFO_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_CONTACT_INFO_H_ | 6 #define CHROME_BROWSER_AUTOFILL_CONTACT_INFO_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/autofill/field_types.h" | 13 #include "chrome/browser/autofill/field_types.h" |
| 14 #include "chrome/browser/autofill/form_group.h" | 14 #include "chrome/browser/autofill/form_group.h" |
| 15 | 15 |
| 16 // A form group that stores name information. | 16 // A form group that stores name information. |
| 17 class NameInfo : public FormGroup { | 17 class NameInfo : public FormGroup { |
| 18 public: | 18 public: |
| 19 NameInfo(); | 19 NameInfo(); |
| 20 NameInfo(const NameInfo& info); | 20 NameInfo(const NameInfo& info); |
| 21 virtual ~NameInfo(); | 21 virtual ~NameInfo(); |
| 22 | 22 |
| 23 NameInfo& operator=(const NameInfo& info); | 23 NameInfo& operator=(const NameInfo& info); |
| 24 | 24 |
| 25 // FormGroup: | 25 // FormGroup: |
| 26 virtual string16 GetInfo(AutofillFieldType type) const OVERRIDE; | 26 virtual string16 GetInfo(AutofillFieldType type) const OVERRIDE; |
| 27 virtual void SetInfo(AutofillFieldType type, const string16& value) OVERRIDE; | 27 virtual void SetInfo(AutofillFieldType type, const string16& value) OVERRIDE; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 FRIEND_TEST_ALL_PREFIXES(NameInfoTest, TestSetFullName); | |
| 31 | |
| 32 // FormGroup: | 30 // FormGroup: |
| 33 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; | 31 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; |
| 34 | 32 |
| 35 // Returns the full name, which can include up to the first, middle, and last | 33 // Returns the full name, which can include up to the first, middle, and last |
| 36 // name. | 34 // name. |
| 37 string16 FullName() const; | 35 string16 FullName() const; |
| 38 | 36 |
| 39 // Returns the middle initial if |middle_| is non-empty. Returns an empty | 37 // Returns the middle initial if |middle_| is non-empty. Returns an empty |
| 40 // string otherwise. | 38 // string otherwise. |
| 41 string16 MiddleInitial() const; | 39 string16 MiddleInitial() const; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 virtual void SetInfo(AutofillFieldType type, const string16& value) OVERRIDE; | 83 virtual void SetInfo(AutofillFieldType type, const string16& value) OVERRIDE; |
| 86 | 84 |
| 87 private: | 85 private: |
| 88 // FormGroup: | 86 // FormGroup: |
| 89 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; | 87 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; |
| 90 | 88 |
| 91 string16 company_name_; | 89 string16 company_name_; |
| 92 }; | 90 }; |
| 93 | 91 |
| 94 #endif // CHROME_BROWSER_AUTOFILL_CONTACT_INFO_H_ | 92 #endif // CHROME_BROWSER_AUTOFILL_CONTACT_INFO_H_ |
| OLD | NEW |