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

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

Issue 1392623002: [Autofill] Add metric for profile action on form submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 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
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_AUTOFILL_PROFILE_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <iosfwd> 10 #include <iosfwd>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Returns true if the data in this AutofillProfile is a subset of the data in 107 // Returns true if the data in this AutofillProfile is a subset of the data in
108 // |profile|. 108 // |profile|.
109 bool IsSubsetOf(const AutofillProfile& profile, 109 bool IsSubsetOf(const AutofillProfile& profile,
110 const std::string& app_locale) const; 110 const std::string& app_locale) const;
111 111
112 // Like IsSubsetOf, but only considers the types present in |types|. 112 // Like IsSubsetOf, but only considers the types present in |types|.
113 bool IsSubsetOfForFieldSet(const AutofillProfile& profile, 113 bool IsSubsetOfForFieldSet(const AutofillProfile& profile,
114 const std::string& app_locale, 114 const std::string& app_locale,
115 const ServerFieldTypeSet& types) const; 115 const ServerFieldTypeSet& types) const;
116 116
117 // Overwrites the field data in |profile| with this Profile. 117 // Overwrites the field data in |profile| with this Profile. Returns |true| if
118 void OverwriteWith(const AutofillProfile& profile, 118 // at least one field was overwritten.
119 bool OverwriteWith(const AutofillProfile& profile,
119 const std::string& app_locale); 120 const std::string& app_locale);
120 121
121 // Saves info from |profile| into |this|, provided |this| and |profile| do not 122 // Saves info from |profile| into |this|, provided |this| and |profile| do not
122 // have any direct conflicts (i.e. data is present but different). Will not 123 // have any direct conflicts (i.e. data is present but different). Will not
123 // make changes if |this| is verified and |profile| is not. Returns true if 124 // make changes if |this| is verified and |profile| is not. Returns true if
124 // |this| and |profile| are similar. 125 // |this| and |profile| are similar.
125 bool SaveAdditionalInfo(const AutofillProfile& profile, 126 bool SaveAdditionalInfo(const AutofillProfile& profile,
126 const std::string& app_locale); 127 const std::string& app_locale);
127 128
128 // Returns |true| if |type| accepts multi-values. 129 // Returns |true| if |type| accepts multi-values.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 213
213 // Utilities for listing and lookup of the data members that constitute 214 // Utilities for listing and lookup of the data members that constitute
214 // user-visible profile information. 215 // user-visible profile information.
215 FormGroupList FormGroups() const; 216 FormGroupList FormGroups() const;
216 const FormGroup* FormGroupForType(const AutofillType& type) const; 217 const FormGroup* FormGroupForType(const AutofillType& type) const;
217 FormGroup* MutableFormGroupForType(const AutofillType& type); 218 FormGroup* MutableFormGroupForType(const AutofillType& type);
218 219
219 // If |name| has the same full name representation as |name_|, 220 // If |name| has the same full name representation as |name_|,
220 // this will keep the one that has more information (i.e. 221 // this will keep the one that has more information (i.e.
221 // is not reconstructible via a heuristic parse of the full name string). 222 // is not reconstructible via a heuristic parse of the full name string).
222 void OverwriteName(const NameInfo& name, const std::string& app_locale); 223 // Returns |true| is |name_| was overwritten.
224 bool OverwriteName(const NameInfo& name, const std::string& app_locale);
223 225
224 // Same as operator==, but ignores differences in GUID. 226 // Same as operator==, but ignores differences in GUID.
225 bool EqualsSansGuid(const AutofillProfile& profile) const; 227 bool EqualsSansGuid(const AutofillProfile& profile) const;
226 228
227 RecordType record_type_; 229 RecordType record_type_;
228 230
229 // Personal information for this profile. 231 // Personal information for this profile.
230 NameInfo name_; 232 NameInfo name_;
231 EmailInfo email_; 233 EmailInfo email_;
232 CompanyInfo company_; 234 CompanyInfo company_;
233 PhoneNumber phone_number_; 235 PhoneNumber phone_number_;
234 Address address_; 236 Address address_;
235 237
236 // The BCP 47 language code that can be used to format |address_| for display. 238 // The BCP 47 language code that can be used to format |address_| for display.
237 std::string language_code_; 239 std::string language_code_;
238 240
239 // ID used for identifying this profile. Only set for SERVER_PROFILEs. This is 241 // ID used for identifying this profile. Only set for SERVER_PROFILEs. This is
240 // a hash of the contents. 242 // a hash of the contents.
241 std::string server_id_; 243 std::string server_id_;
242 }; 244 };
243 245
244 // So we can compare AutofillProfiles with EXPECT_EQ(). 246 // So we can compare AutofillProfiles with EXPECT_EQ().
245 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); 247 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile);
246 248
247 } // namespace autofill 249 } // namespace autofill
248 250
249 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ 251 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698