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

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

Issue 545175: Add the ability to save and remove AutoFill profiles from the AutoFillDialog.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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_profile.h ('k') | chrome/browser/autofill/personal_data_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile.cc
===================================================================
--- chrome/browser/autofill/autofill_profile.cc (revision 36778)
+++ chrome/browser/autofill/autofill_profile.cc (working copy)
@@ -144,8 +144,9 @@
if (label_ != profile.label_ ||
unique_id_ != profile.unique_id_ ||
- use_billing_address_ != profile.use_billing_address_)
+ use_billing_address_ != profile.use_billing_address_) {
return false;
+ }
for (size_t index = 0; index < arraysize(types); ++index) {
if (GetFieldText(AutoFillType(types[index])) !=
@@ -183,3 +184,39 @@
Address* AutoFillProfile::GetHomeAddress() {
return static_cast<Address*>(personal_info_[AutoFillType::ADDRESS_HOME]);
}
+
+// So we can compare AutoFillProfiles with EXPECT_EQ().
+std::ostream& operator<<(std::ostream& os, const AutoFillProfile& profile) {
+ return os
+ << UTF16ToASCII(profile.Label())
+ << " "
+ << profile.unique_id()
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(NAME_FIRST)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(NAME_MIDDLE)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(NAME_LAST)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(EMAIL_ADDRESS)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(COMPANY_NAME)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_LINE1)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_LINE2)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_CITY)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_STATE)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(
+ PHONE_HOME_WHOLE_NUMBER)))
+ << " "
+ << UTF16ToUTF8(profile.GetFieldText(AutoFillType(
+ PHONE_FAX_WHOLE_NUMBER)));
+}
« no previous file with comments | « chrome/browser/autofill/autofill_profile.h ('k') | chrome/browser/autofill/personal_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698