Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: components/autofill/core/browser/contact_info.h

Issue 1973873002: [Autofill] Improve the merging of two profiles' names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // For every non-empty NameInfo part in |new_name|, the corresponding NameInfo
30 // part in | this | is overwritten.Special logic so that a middle initial may
31 // not overwrite a full middle name.
32 void OverwriteName(const NameInfo& new_name);
33
34 // Returns true if all the name parts (first, middle and last) are empty.
35 bool NamePartsAreEmpty() const;
36
29 // FormGroup: 37 // FormGroup:
30 base::string16 GetRawInfo(ServerFieldType type) const override; 38 base::string16 GetRawInfo(ServerFieldType type) const override;
31 void SetRawInfo(ServerFieldType type, const base::string16& value) override; 39 void SetRawInfo(ServerFieldType type, const base::string16& value) override;
32 base::string16 GetInfo(const AutofillType& type, 40 base::string16 GetInfo(const AutofillType& type,
33 const std::string& app_locale) const override; 41 const std::string& app_locale) const override;
34 bool SetInfo(const AutofillType& type, 42 bool SetInfo(const AutofillType& type,
35 const base::string16& value, 43 const base::string16& value,
36 const std::string& app_locale) override; 44 const std::string& app_locale) override;
37 45
38 private: 46 private:
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 private: 98 private:
91 // FormGroup: 99 // FormGroup:
92 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; 100 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override;
93 101
94 base::string16 company_name_; 102 base::string16 company_name_;
95 }; 103 };
96 104
97 } // namespace autofill 105 } // namespace autofill
98 106
99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_ 107 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_profile_unittest.cc ('k') | components/autofill/core/browser/contact_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698