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

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

Issue 7892048: Autofill: Remove fax number completely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix. Created 9 years, 3 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/autofill_profile_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile.cc
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
index 26565945aab8d312d12b3853aaa06d7c44a612e3..368b4e64ddde525e38c40574e1cc88dd86bef3f3 100644
--- a/chrome/browser/autofill/autofill_profile.cc
+++ b/chrome/browser/autofill/autofill_profile.cc
@@ -56,7 +56,6 @@ void GetFieldsForDistinguishingProfiles(
ADDRESS_HOME_COUNTRY,
EMAIL_ADDRESS,
PHONE_HOME_WHOLE_NUMBER,
- PHONE_FAX_WHOLE_NUMBER,
COMPANY_NAME,
};
@@ -167,14 +166,6 @@ void CollapseCompoundFieldTypes(FieldTypeSet* type_set) {
collapsed_set.insert(PHONE_HOME_WHOLE_NUMBER);
break;
- case PHONE_FAX_NUMBER:
- case PHONE_FAX_CITY_CODE:
- case PHONE_FAX_COUNTRY_CODE:
- case PHONE_FAX_CITY_AND_NUMBER:
- case PHONE_FAX_WHOLE_NUMBER:
- collapsed_set.insert(PHONE_FAX_WHOLE_NUMBER);
- break;
-
default:
collapsed_set.insert(*iter);
}
@@ -208,16 +199,14 @@ AutofillProfile::AutofillProfile(const std::string& guid)
: guid_(guid),
name_(1),
email_(1),
- home_number_(1, PhoneNumber(AutofillType::PHONE_HOME, this)),
- fax_number_(1, PhoneNumber(AutofillType::PHONE_FAX, this)) {
+ home_number_(1, PhoneNumber(this)) {
}
AutofillProfile::AutofillProfile()
: guid_(guid::GenerateGUID()),
name_(1),
email_(1),
- home_number_(1, PhoneNumber(AutofillType::PHONE_HOME, this)),
- fax_number_(1, PhoneNumber(AutofillType::PHONE_FAX, this)) {
+ home_number_(1, PhoneNumber(this)) {
}
AutofillProfile::AutofillProfile(const AutofillProfile& profile)
@@ -239,13 +228,10 @@ AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) {
email_ = profile.email_;
company_ = profile.company_;
home_number_ = profile.home_number_;
- for (size_t i = 0; i < home_number_.size(); ++i) {
+
+ for (size_t i = 0; i < home_number_.size(); ++i)
home_number_[i].set_profile(this);
- }
- fax_number_ = profile.fax_number_;
- for (size_t i = 0; i < fax_number_.size(); ++i) {
- fax_number_[i].set_profile(this);
- }
+
address_ = profile.address_;
return *this;
@@ -313,13 +299,7 @@ void AutofillProfile::SetMultiInfo(AutofillFieldType type,
CopyValuesToItems(type,
values,
&home_number_,
- PhoneNumber(AutofillType::PHONE_HOME, this));
- break;
- case AutofillType::PHONE_FAX:
- CopyValuesToItems(type,
- values,
- &fax_number_,
- PhoneNumber(AutofillType::PHONE_FAX, this));
+ PhoneNumber(this));
break;
default:
if (values.size() == 1) {
@@ -357,9 +337,6 @@ void AutofillProfile::GetMultiInfoImpl(AutofillFieldType type,
case AutofillType::PHONE_HOME:
CopyItemsToValues(type, home_number_, canonicalize, values);
break;
- case AutofillType::PHONE_FAX:
- CopyItemsToValues(type, fax_number_, canonicalize, values);
- break;
default:
values->resize(1);
(*values)[0] = GetInfo(type);
@@ -371,8 +348,7 @@ bool AutofillProfile::SupportsMultiValue(AutofillFieldType type) {
AutofillType::FieldTypeGroup group = AutofillType(type).group();
return group == AutofillType::NAME ||
group == AutofillType::EMAIL ||
- group == AutofillType::PHONE_HOME ||
- group == AutofillType::PHONE_FAX;
+ group == AutofillType::PHONE_HOME;
}
const string16 AutofillProfile::Label() const {
@@ -470,8 +446,7 @@ int AutofillProfile::Compare(const AutofillProfile& profile) const {
ADDRESS_HOME_STATE,
ADDRESS_HOME_ZIP,
ADDRESS_HOME_COUNTRY,
- PHONE_HOME_NUMBER,
- PHONE_FAX_NUMBER };
+ PHONE_HOME_NUMBER };
for (size_t index = 0; index < arraysize(types); ++index) {
int comparison = GetInfo(types[index]).compare(
@@ -503,8 +478,7 @@ int AutofillProfile::CompareMulti(const AutofillProfile& profile) const {
NAME_MIDDLE,
NAME_LAST,
EMAIL_ADDRESS,
- PHONE_HOME_NUMBER,
- PHONE_FAX_NUMBER };
+ PHONE_HOME_NUMBER };
for (size_t i = 0; i < arraysize(multi_value_types); ++i) {
std::vector<string16> values_a;
@@ -567,8 +541,7 @@ void AutofillProfile::OverwriteWithOrAddTo(const AutofillProfile& profile) {
for (std::vector<string16>::iterator value_iter = new_values.begin();
value_iter != new_values.end(); ++value_iter) {
// Don't add duplicates.
- if (group == AutofillType::PHONE_HOME ||
- group == AutofillType::PHONE_FAX) {
+ if (group == AutofillType::PHONE_HOME) {
AddPhoneIfUnique(*value_iter, &existing_values);
} else {
std::vector<string16>::const_iterator existing_iter = std::find_if(
@@ -617,11 +590,6 @@ string16 AutofillProfile::ConstructInferredLabel(
if (!label.empty())
label.append(separator);
- // Fax number has special format, to indicate that this is a fax number.
- if (*it == PHONE_FAX_WHOLE_NUMBER) {
- field = l10n_util::GetStringFUTF16(
- IDS_AUTOFILL_DIALOG_ADDRESS_SUMMARY_FAX_FORMAT, field);
- }
label.append(field);
++num_fields_used;
}
@@ -706,13 +674,12 @@ void AutofillProfile::CreateDifferentiatingLabels(
}
AutofillProfile::FormGroupList AutofillProfile::FormGroups() const {
- FormGroupList v(6);
+ FormGroupList v(5);
v[0] = &name_[0];
v[1] = &email_[0];
v[2] = &company_;
v[3] = &home_number_[0];
- v[4] = &fax_number_[0];
- v[5] = &address_;
+ v[4] = &address_;
return v;
}
@@ -736,9 +703,6 @@ FormGroup* AutofillProfile::MutableFormGroupForType(AutofillFieldType type) {
case AutofillType::PHONE_HOME:
form_group = &home_number_[0];
break;
- case AutofillType::PHONE_FAX:
- form_group = &fax_number_[0];
- break;
case AutofillType::ADDRESS_HOME:
form_group = &address_;
break;
@@ -777,7 +741,5 @@ std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile) {
<< " "
<< UTF16ToUTF8(profile.GetInfo(ADDRESS_HOME_COUNTRY))
<< " "
- << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER))
- << " "
- << UTF16ToUTF8(MultiString(profile, PHONE_FAX_WHOLE_NUMBER));
+ << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER));
}
« no previous file with comments | « chrome/browser/autofill/autofill_profile.h ('k') | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698