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

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

Issue 7892048: Autofill: Remove fax number completely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/autofill/phone_number.cc
diff --git a/chrome/browser/autofill/phone_number.cc b/chrome/browser/autofill/phone_number.cc
index abc107d6de760f20436108339d8b02684f90f1a3..768d99c974dca4a55f9708f19e3ad30337e378d6 100644
--- a/chrome/browser/autofill/phone_number.cc
+++ b/chrome/browser/autofill/phone_number.cc
@@ -59,6 +59,7 @@ PhoneNumber::~PhoneNumber() {}
PhoneNumber& PhoneNumber::operator=(const PhoneNumber& number) {
if (this == &number)
return *this;
+
phone_group_ = number.phone_group_;
number_ = number.number_;
profile_ = number.profile_;
@@ -150,7 +151,7 @@ void PhoneNumber::GetMatchingTypes(const string16& text,
FormGroup::GetMatchingTypes(stripped_text, matching_types);
// For US numbers, also compare to the three-digit prefix and the four-digit
- // suffix, since websites often split numbers into these two fields.
+ // suffix, since web sites often split numbers into these two fields.
string16 number = GetCanonicalizedInfo(GetNumberType());
if (locale() == "US" && number.size() == (kPrefixLength + kSuffixLength)) {
string16 prefix = number.substr(kPrefixOffset, kPrefixLength);
@@ -191,53 +192,23 @@ void PhoneNumber::UpdateCacheIfNeeded() const {
}
AutofillFieldType PhoneNumber::GetNumberType() const {
- if (phone_group_ == AutofillType::PHONE_HOME)
- return PHONE_HOME_NUMBER;
- else if (phone_group_ == AutofillType::PHONE_FAX)
- return PHONE_FAX_NUMBER;
- else
- NOTREACHED();
- return UNKNOWN_TYPE;
+ return PHONE_HOME_NUMBER;
}
AutofillFieldType PhoneNumber::GetCityCodeType() const {
- if (phone_group_ == AutofillType::PHONE_HOME)
- return PHONE_HOME_CITY_CODE;
- else if (phone_group_ == AutofillType::PHONE_FAX)
- return PHONE_FAX_CITY_CODE;
- else
- NOTREACHED();
- return UNKNOWN_TYPE;
+ return PHONE_HOME_CITY_CODE;
}
AutofillFieldType PhoneNumber::GetCountryCodeType() const {
- if (phone_group_ == AutofillType::PHONE_HOME)
- return PHONE_HOME_COUNTRY_CODE;
- else if (phone_group_ == AutofillType::PHONE_FAX)
- return PHONE_FAX_COUNTRY_CODE;
- else
- NOTREACHED();
- return UNKNOWN_TYPE;
+ return PHONE_HOME_COUNTRY_CODE;
}
AutofillFieldType PhoneNumber::GetCityAndNumberType() const {
- if (phone_group_ == AutofillType::PHONE_HOME)
- return PHONE_HOME_CITY_AND_NUMBER;
- else if (phone_group_ == AutofillType::PHONE_FAX)
- return PHONE_FAX_CITY_AND_NUMBER;
- else
- NOTREACHED();
- return UNKNOWN_TYPE;
+ return PHONE_HOME_CITY_AND_NUMBER;
}
AutofillFieldType PhoneNumber::GetWholeNumberType() const {
- if (phone_group_ == AutofillType::PHONE_HOME)
- return PHONE_HOME_WHOLE_NUMBER;
- else if (phone_group_ == AutofillType::PHONE_FAX)
- return PHONE_FAX_WHOLE_NUMBER;
- else
- NOTREACHED();
- return UNKNOWN_TYPE;
+ return PHONE_HOME_WHOLE_NUMBER;
}
PhoneNumber::PhoneCombineHelper::PhoneCombineHelper(

Powered by Google App Engine
This is Rietveld 408576698