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

Unified Diff: components/autofill/core/browser/autofill_profile.cc

Issue 23579009: [rAc] Move email address into billing address section. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update Mac test expectations Created 7 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 | « components/autofill/core/browser/autofill_metrics.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 6e18011e5c439f5a43bd53c1bf9154879f183fa4..7086352036837c79a8ee7d7d6233fc72e87655a2 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -417,29 +417,26 @@ bool AutofillProfile::IsEmpty(const std::string& app_locale) const {
bool AutofillProfile::IsPresentButInvalid(ServerFieldType type) const {
std::string country = UTF16ToUTF8(GetRawInfo(ADDRESS_HOME_COUNTRY));
base::string16 data = GetRawInfo(type);
+ if (data.empty())
+ return false;
+
switch (type) {
case ADDRESS_HOME_STATE:
- if (!data.empty() && country == "US" && !autofill::IsValidState(data))
- return true;
- break;
+ return country == "US" && !autofill::IsValidState(data);
case ADDRESS_HOME_ZIP:
- if (!data.empty() && country == "US" && !autofill::IsValidZip(data))
- return true;
- break;
+ return country == "US" && !autofill::IsValidZip(data);
- case PHONE_HOME_WHOLE_NUMBER: {
- if (!data.empty() && !i18n::PhoneObject(data, country).IsValidNumber())
- return true;
- break;
- }
+ case PHONE_HOME_WHOLE_NUMBER:
+ return !i18n::PhoneObject(data, country).IsValidNumber();
+
+ case EMAIL_ADDRESS:
+ return !autofill::IsValidEmailAddress(data);
default:
NOTREACHED();
- break;
+ return false;
}
-
- return false;
}
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698