Chromium Code Reviews| 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" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "components/autofill/core/browser/form_group.h" | 12 #include "components/autofill/core/browser/form_group.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 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 ~NameInfo() override; | 21 ~NameInfo() override; |
| 22 | 22 |
| 23 NameInfo& operator=(const NameInfo& info); | 23 NameInfo& operator=(const NameInfo& info); |
| 24 | 24 |
| 25 // Compares |NameInfo| objects for |given_|, |middle_| and |family_| names. | 25 // Compares |NameInfo| objects for |given_|, |middle_| and |family_| names. |
| 26 // The comparison is case sensitive. | 26 // The comparison is case sensitive. |
| 27 bool ParsedNamesAreEqual(const NameInfo& info) const; | 27 bool ParsedNamesAreEqual(const NameInfo& info) const; |
| 28 | 28 |
| 29 // Overwrites |this| NameInfo parts with the |new_name| parts if they have | |
| 30 // more information. | |
|
Mathieu
2016/05/13 13:32:51
// For every non-empty NameInfo part in |new_name|
sebsg
2016/05/13 17:20:02
Done.
| |
| 31 void OverwriteName(const NameInfo& new_name); | |
| 32 | |
| 33 // Returns true if all the name parts (first, middle and last) are empty. | |
| 34 bool NamePartsAreEmpty() const; | |
| 35 | |
| 29 // FormGroup: | 36 // FormGroup: |
| 30 base::string16 GetRawInfo(ServerFieldType type) const override; | 37 base::string16 GetRawInfo(ServerFieldType type) const override; |
| 31 void SetRawInfo(ServerFieldType type, const base::string16& value) override; | 38 void SetRawInfo(ServerFieldType type, const base::string16& value) override; |
| 32 base::string16 GetInfo(const AutofillType& type, | 39 base::string16 GetInfo(const AutofillType& type, |
| 33 const std::string& app_locale) const override; | 40 const std::string& app_locale) const override; |
| 34 bool SetInfo(const AutofillType& type, | 41 bool SetInfo(const AutofillType& type, |
| 35 const base::string16& value, | 42 const base::string16& value, |
| 36 const std::string& app_locale) override; | 43 const std::string& app_locale) override; |
| 37 | 44 |
| 38 private: | 45 private: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 private: | 97 private: |
| 91 // FormGroup: | 98 // FormGroup: |
| 92 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; | 99 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; |
| 93 | 100 |
| 94 base::string16 company_name_; | 101 base::string16 company_name_; |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 } // namespace autofill | 104 } // namespace autofill |
| 98 | 105 |
| 99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ | 106 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ |
| OLD | NEW |