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

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

Issue 6877130: These changes *are* for review :) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
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 #include <list> 10 #include <list>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Equality operators compare GUIDs and the contents in the comparison. 112 // Equality operators compare GUIDs and the contents in the comparison.
113 // TODO(dhollowa): This needs to be made multi-profile once Sync updates. 113 // TODO(dhollowa): This needs to be made multi-profile once Sync updates.
114 bool operator==(const AutofillProfile& profile) const; 114 bool operator==(const AutofillProfile& profile) const;
115 virtual bool operator!=(const AutofillProfile& profile) const; 115 virtual bool operator!=(const AutofillProfile& profile) const;
116 116
117 // Returns concatenation of full name and address line 1. This acts as the 117 // Returns concatenation of full name and address line 1. This acts as the
118 // basis of comparison for new values that are submitted through forms to 118 // basis of comparison for new values that are submitted through forms to
119 // aid with correct aggregation of new data. 119 // aid with correct aggregation of new data.
120 const string16 PrimaryValue() const; 120 const string16 PrimaryValue() const;
121 121
122 // Normalizes the phone and numbers.
dhollowa 2011/05/13 18:55:35 nit: "Normalizes the home phone and fax numbers."
GeorgeY 2011/05/18 17:41:45 Done.
123 // Should be called after all of the form data is imported into profile.
124 // If PHONE_*_WHOLE_NUMBER is not set, then derives it from PHONE_*_CITY_CODE,
125 // PHONE_*_COUNTRY_CODE and PHONE_*_CITY_AND_NUMBER.
126 // Drops unparsable numbers, so the numbers that are incomplete or wrong
127 // are not saved. Returns true if all numbers were successfully parsed,
128 // false otherwise.
129 bool NormalizePhones();
130
122 // Overwrites the single-valued field data in |profile| with this 131 // Overwrites the single-valued field data in |profile| with this
123 // Profile. Or, for multi-valued fields append the new values. 132 // Profile. Or, for multi-valued fields append the new values.
124 void OverwriteWithOrAddTo(const AutofillProfile& profile); 133 void OverwriteWithOrAddTo(const AutofillProfile& profile);
125 134
126 private: 135 private:
127 typedef std::vector<const FormGroup*> FormGroupList; 136 typedef std::vector<const FormGroup*> FormGroupList;
128 137
129 // Builds inferred label from the first |num_fields_to_include| non-empty 138 // Builds inferred label from the first |num_fields_to_include| non-empty
130 // fields in |label_fields|. Uses as many fields as possible if there are not 139 // fields in |label_fields|. Uses as many fields as possible if there are not
131 // enough non-empty fields. 140 // enough non-empty fields.
(...skipping 22 matching lines...) Expand all
154 // The label presented to the user when selecting a profile. 163 // The label presented to the user when selecting a profile.
155 string16 label_; 164 string16 label_;
156 165
157 // The guid of this profile. 166 // The guid of this profile.
158 std::string guid_; 167 std::string guid_;
159 168
160 // Personal information for this profile. 169 // Personal information for this profile.
161 std::vector<NameInfo> name_; 170 std::vector<NameInfo> name_;
162 std::vector<EmailInfo> email_; 171 std::vector<EmailInfo> email_;
163 CompanyInfo company_; 172 CompanyInfo company_;
164 std::vector<HomePhoneNumber> home_number_; 173 std::vector<PhoneNumber> home_number_;
165 std::vector<FaxNumber> fax_number_; 174 std::vector<PhoneNumber> fax_number_;
166 Address address_; 175 Address address_;
167 }; 176 };
168 177
169 // So we can compare AutofillProfiles with EXPECT_EQ(). 178 // So we can compare AutofillProfiles with EXPECT_EQ().
170 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); 179 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile);
171 180
172 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_ 181 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698