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

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

Issue 970403002: Don't suggest autofill profiles that are subsets of other profiles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Returns concatenation of full name and address line 1. This acts as the 115 // Returns concatenation of full name and address line 1. This acts as the
116 // basis of comparison for new values that are submitted through forms to 116 // basis of comparison for new values that are submitted through forms to
117 // aid with correct aggregation of new data. 117 // aid with correct aggregation of new data.
118 const base::string16 PrimaryValue() const; 118 const base::string16 PrimaryValue() const;
119 119
120 // Returns true if the data in this AutofillProfile is a subset of the data in 120 // Returns true if the data in this AutofillProfile is a subset of the data in
121 // |profile|. 121 // |profile|.
122 bool IsSubsetOf(const AutofillProfile& profile, 122 bool IsSubsetOf(const AutofillProfile& profile,
123 const std::string& app_locale) const; 123 const std::string& app_locale) const;
124 124
125 // Like IsSubsetOf, but only considers the types present in |types|.
126 bool IsSubsetOfForFieldSet(const AutofillProfile& profile,
127 const std::string& app_locale,
128 const ServerFieldTypeSet& types) const;
129
125 // Overwrites the single-valued field data in |profile| with this 130 // Overwrites the single-valued field data in |profile| with this
126 // Profile. Or, for multi-valued fields append the new values. 131 // Profile. Or, for multi-valued fields append the new values.
127 void OverwriteWithOrAddTo(const AutofillProfile& profile, 132 void OverwriteWithOrAddTo(const AutofillProfile& profile,
128 const std::string& app_locale); 133 const std::string& app_locale);
129 134
130 // Sets |name_| to the user-input values in |names|, but uses names in |from| 135 // Sets |name_| to the user-input values in |names|, but uses names in |from|
131 // as a starting point. If the full names are equivalent, the parsing in 136 // as a starting point. If the full names are equivalent, the parsing in
132 // |from| will take precedence. |from| can be null. 137 // |from| will take precedence. |from| can be null.
133 void CopyAndUpdateNameList(const std::vector<base::string16> names, 138 void CopyAndUpdateNameList(const std::vector<base::string16> names,
134 const AutofillProfile* from, 139 const AutofillProfile* from,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // ID assigned by the server. This will be set only for WALLET_PROFILEs. 256 // ID assigned by the server. This will be set only for WALLET_PROFILEs.
252 std::string server_id_; 257 std::string server_id_;
253 }; 258 };
254 259
255 // So we can compare AutofillProfiles with EXPECT_EQ(). 260 // So we can compare AutofillProfiles with EXPECT_EQ().
256 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); 261 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile);
257 262
258 } // namespace autofill 263 } // namespace autofill
259 264
260 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ 265 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698