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

Unified Diff: chrome/browser/autofill/contact_info.cc

Issue 2818033: AutoFill: Aggregate profile data. Remove the AutoFill InfoBar. (Closed)
Patch Set: Comment. Created 10 years, 6 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/contact_info.h ('k') | chrome/browser/autofill/credit_card.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/contact_info.cc
diff --git a/chrome/browser/autofill/contact_info.cc b/chrome/browser/autofill/contact_info.cc
index 0355fd0728f181163b542656708d6ce837017af2..0709a246d5df7ad5d4fe2ccf953946a9d382dc24 100644
--- a/chrome/browser/autofill/contact_info.cc
+++ b/chrome/browser/autofill/contact_info.cc
@@ -28,6 +28,8 @@ FormGroup* ContactInfo::Clone() const {
void ContactInfo::GetPossibleFieldTypes(const string16& text,
FieldTypeSet* possible_types) const {
+ DCHECK(possible_types);
+
if (IsFirstName(text))
possible_types->insert(NAME_FIRST);
@@ -53,13 +55,38 @@ void ContactInfo::GetPossibleFieldTypes(const string16& text,
possible_types->insert(COMPANY_NAME);
}
+void ContactInfo::GetAvailableFieldTypes(FieldTypeSet* available_types) const {
+ DCHECK(available_types);
+
+ if (!first().empty())
+ available_types->insert(NAME_FIRST);
+
+ if (!middle().empty())
+ available_types->insert(NAME_MIDDLE);
+
+ if (!last().empty())
+ available_types->insert(NAME_LAST);
+
+ if (!MiddleInitial().empty())
+ available_types->insert(NAME_MIDDLE_INITIAL);
+
+ if (!FullName().empty())
+ available_types->insert(NAME_FULL);
+
+ if (!suffix().empty())
+ available_types->insert(NAME_SUFFIX);
+
+ if (!email().empty())
+ available_types->insert(EMAIL_ADDRESS);
+
+ if (!company_name().empty())
+ available_types->insert(COMPANY_NAME);
+}
+
void ContactInfo::FindInfoMatches(const AutoFillType& type,
const string16& info,
std::vector<string16>* matched_text) const {
- if (matched_text == NULL) {
- DLOG(ERROR) << "NULL matched vector passed in";
- return;
- }
+ DCHECK(matched_text);
string16 match;
if (type.field_type() == UNKNOWN_TYPE) {
« no previous file with comments | « chrome/browser/autofill/contact_info.h ('k') | chrome/browser/autofill/credit_card.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698