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

Unified Diff: chrome/browser/autofill/autofill_profile.h

Issue 2835026: Added inferred labels implementation. Label inferred from the person name + d... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | chrome/browser/autofill/autofill_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile.h
===================================================================
--- chrome/browser/autofill/autofill_profile.h (revision 52727)
+++ chrome/browser/autofill/autofill_profile.h (working copy)
@@ -56,6 +56,30 @@
// The form of the string is governed by generated resources.
string16 PreviewSummary() const;
+ // Adjusts the labels according to profile data.
+ // Labels contain minimal different combination of:
+ // 1. Full name.
+ // 2. Address.
+ // 3. E-mail.
+ // 4. Phone.
+ // 5. Fax.
+ // 6. Company name.
+ // Profile labels are changed accordingly to these rules.
+ // Returns true if any of the profiles were updated.
+ // This function is useful if you want to adjust unique labels for all
+ // profiles. For non permanent situations (selection of profile, when user
+ // started typing in the field, for example) use CreateInferredLabels().
+ static bool AdjustInferredLabels(std::vector<AutoFillProfile*>* profiles);
+
+ // Created inferred labels for |profiles|, according to the rules above and
+ // stores them in |created_labels|. |minimal_fields_shown| minimal number of
+ // fields that need to be shown for the label. |exclude_field| is excluded
+ // from the label.
+ static void CreateInferredLabels(
+ const std::vector<AutoFillProfile*>* profiles,
+ std::vector<string16>* created_labels,
+ size_t minimal_fields_shown,
+ AutoFillFieldType exclude_field);
// For use in STL containers.
void operator=(const AutoFillProfile&);
@@ -67,6 +91,13 @@
private:
Address* GetHomeAddress();
+ // Builds inferred label, includes first non-empty field at the beginning,
+ // even if it matches for all.
+ // |included_fields| - array of the fields, that needs to be included in this
+ // label.
+ string16 ConstructInferredLabel(
+ const std::vector<AutoFillFieldType>* included_fields) const;
+
// The label presented to the user when selecting a profile.
string16 label_;
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | chrome/browser/autofill/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698