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

Side by Side Diff: chrome/browser/autofill/autofill_profile.h

Issue 8143007: Move a bunch of non-shared methods out of the FormGroup class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: De-nitting Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_AUTOFILL_PROFILE_H_ 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 std::vector<string16>* values) const; 52 std::vector<string16>* values) const;
53 void GetCanonicalizedMultiInfo(AutofillFieldType type, 53 void GetCanonicalizedMultiInfo(AutofillFieldType type,
54 std::vector<string16>* values) const; 54 std::vector<string16>* values) const;
55 55
56 // Returns |true| if |type| accepts multi-values. 56 // Returns |true| if |type| accepts multi-values.
57 static bool SupportsMultiValue(AutofillFieldType type); 57 static bool SupportsMultiValue(AutofillFieldType type);
58 58
59 // The user-visible label of the profile, generated in relation to other 59 // The user-visible label of the profile, generated in relation to other
60 // profiles. Shows at least 2 fields that differentiate profile from other 60 // profiles. Shows at least 2 fields that differentiate profile from other
61 // profiles. See AdjustInferredLabels() further down for more description. 61 // profiles. See AdjustInferredLabels() further down for more description.
62 virtual const string16 Label() const; 62 const string16 Label() const;
63 63
64 // This guid is the primary identifier for |AutofillProfile| objects. 64 // This guid is the primary identifier for |AutofillProfile| objects.
65 const std::string guid() const { return guid_; } 65 const std::string guid() const { return guid_; }
66 void set_guid(const std::string& guid) { guid_ = guid; } 66 void set_guid(const std::string& guid) { guid_ = guid; }
67 67
68 // Accessors for the stored address's country code. 68 // Accessors for the stored address's country code.
69 const std::string CountryCode() const; 69 const std::string CountryCode() const;
70 void SetCountryCode(const std::string& country_code); 70 void SetCountryCode(const std::string& country_code);
71 71
72 // Adjusts the labels according to profile data. 72 // Adjusts the labels according to profile data.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Equality operators compare GUIDs and the contents in the comparison. 115 // Equality operators compare GUIDs and the contents in the comparison.
116 // TODO(dhollowa): This needs to be made multi-profile once Sync updates. 116 // TODO(dhollowa): This needs to be made multi-profile once Sync updates.
117 bool operator==(const AutofillProfile& profile) const; 117 bool operator==(const AutofillProfile& profile) const;
118 virtual bool operator!=(const AutofillProfile& profile) const; 118 virtual bool operator!=(const AutofillProfile& profile) const;
119 119
120 // Returns concatenation of full name and address line 1. This acts as the 120 // Returns concatenation of full name and address line 1. This acts as the
121 // basis of comparison for new values that are submitted through forms to 121 // basis of comparison for new values that are submitted through forms to
122 // aid with correct aggregation of new data. 122 // aid with correct aggregation of new data.
123 const string16 PrimaryValue() const; 123 const string16 PrimaryValue() const;
124 124
125 // Returns true if the data in this AutofillProfile is a subset of the data in
126 // |profile|.
127 bool IsSubsetOf(const AutofillProfile& profile) const;
128
125 // Overwrites the single-valued field data in |profile| with this 129 // Overwrites the single-valued field data in |profile| with this
126 // Profile. Or, for multi-valued fields append the new values. 130 // Profile. Or, for multi-valued fields append the new values.
127 void OverwriteWithOrAddTo(const AutofillProfile& profile); 131 void OverwriteWithOrAddTo(const AutofillProfile& profile);
128 132
129 private: 133 private:
130 typedef std::vector<const FormGroup*> FormGroupList; 134 typedef std::vector<const FormGroup*> FormGroupList;
131 135
132 // FormGroup implementation. 136 // FormGroup implementation.
133 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; 137 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE;
134 138
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 std::vector<EmailInfo> email_; 184 std::vector<EmailInfo> email_;
181 CompanyInfo company_; 185 CompanyInfo company_;
182 std::vector<PhoneNumber> home_number_; 186 std::vector<PhoneNumber> home_number_;
183 Address address_; 187 Address address_;
184 }; 188 };
185 189
186 // So we can compare AutofillProfiles with EXPECT_EQ(). 190 // So we can compare AutofillProfiles with EXPECT_EQ().
187 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); 191 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile);
188 192
189 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ 193 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698