summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-07 07:26:27 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-07 07:26:27 +0000
commit41956440b36ef639e06e16836f00b311ad47e766 (patch)
tree41df2eab6ee0cb15baf85dd7c0fbc7a5b8416a8c /components
parent3ce5b2ece4b704293d29325971b2fb601635cf3c (diff)
downloadchromium_src-41956440b36ef639e06e16836f00b311ad47e766.zip
chromium_src-41956440b36ef639e06e16836f00b311ad47e766.tar.gz
chromium_src-41956440b36ef639e06e16836f00b311ad47e766.tar.bz2
[rAc] Move email address into billing address section.
BUG=258612 TEST=email address appears under billing address section (in Autofill mode) and is still filled correctly (in both modes) R=estade@chromium.org Review URL: https://chromiumcodereview.appspot.com/23579009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221912 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/autofill/core/browser/autofill_metrics.h6
-rw-r--r--components/autofill/core/browser/autofill_profile.cc25
2 files changed, 14 insertions, 17 deletions
diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h
index 41b6077..1c8de64 100644
--- a/components/autofill/core/browser/autofill_metrics.h
+++ b/components/autofill/core/browser/autofill_metrics.h
@@ -122,21 +122,21 @@ class AutofillMetrics {
DIALOG_UI_SIGNIN_SHOWN,
// Selecting a different item from a suggestion menu dropdown:
- DIALOG_UI_EMAIL_SELECTED_SUGGESTION_CHANGED,
+ DEPRECATED_DIALOG_UI_EMAIL_SELECTED_SUGGESTION_CHANGED,
DIALOG_UI_BILLING_SELECTED_SUGGESTION_CHANGED,
DIALOG_UI_CC_BILLING_SELECTED_SUGGESTION_CHANGED,
DIALOG_UI_SHIPPING_SELECTED_SUGGESTION_CHANGED,
DIALOG_UI_CC_SELECTED_SUGGESTION_CHANGED,
// Showing the editing UI for a section of the dialog:
- DIALOG_UI_EMAIL_EDIT_UI_SHOWN,
+ DEPRECATED_DIALOG_UI_EMAIL_EDIT_UI_SHOWN,
DIALOG_UI_BILLING_EDIT_UI_SHOWN,
DIALOG_UI_CC_BILLING_EDIT_UI_SHOWN,
DIALOG_UI_SHIPPING_EDIT_UI_SHOWN,
DIALOG_UI_CC_EDIT_UI_SHOWN,
// Adding a new item in a section of the dialog:
- DIALOG_UI_EMAIL_ITEM_ADDED,
+ DEPRECATED_DIALOG_UI_EMAIL_ITEM_ADDED,
DIALOG_UI_BILLING_ITEM_ADDED,
DIALOG_UI_CC_BILLING_ITEM_ADDED,
DIALOG_UI_SHIPPING_ITEM_ADDED,
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 1101435..735549f 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;
}