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

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

Issue 322453003: autocomplete: support address-line3, address-level{1,2,3} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test expectations Created 6 years, 6 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: components/autofill/core/browser/address.cc
diff --git a/components/autofill/core/browser/address.cc b/components/autofill/core/browser/address.cc
index 5ca29290bfda5b6c4fa9f27a2866438ee7bd1a71..fc2e5a3c6ffc3429eb05d4d6e3e04d0465c3c7ff 100644
--- a/components/autofill/core/browser/address.cc
+++ b/components/autofill/core/browser/address.cc
@@ -49,6 +49,9 @@ base::string16 Address::GetRawInfo(ServerFieldType type) const {
case ADDRESS_HOME_LINE2:
return street_address_.size() > 1 ? street_address_[1] : base::string16();
+ case ADDRESS_HOME_LINE3:
+ return street_address_.size() > 2 ? street_address_[2] : base::string16();
+
case ADDRESS_HOME_DEPENDENT_LOCALITY:
return dependent_locality_;
@@ -93,6 +96,13 @@ void Address::SetRawInfo(ServerFieldType type, const base::string16& value) {
TrimStreetAddress();
break;
+ case ADDRESS_HOME_LINE3:
+ if (street_address_.size() < 3)
+ street_address_.resize(3);
+ street_address_[2] = value;
+ TrimStreetAddress();
+ break;
+
case ADDRESS_HOME_DEPENDENT_LOCALITY:
dependent_locality_ = value;
break;
@@ -201,6 +211,7 @@ void Address::GetMatchingTypes(const base::string16& text,
void Address::GetSupportedTypes(ServerFieldTypeSet* supported_types) const {
supported_types->insert(ADDRESS_HOME_LINE1);
supported_types->insert(ADDRESS_HOME_LINE2);
+ supported_types->insert(ADDRESS_HOME_LINE3);
supported_types->insert(ADDRESS_HOME_STREET_ADDRESS);
supported_types->insert(ADDRESS_HOME_DEPENDENT_LOCALITY);
supported_types->insert(ADDRESS_HOME_CITY);
« no previous file with comments | « components/autofill/content/renderer/form_cache.cc ('k') | components/autofill/core/browser/address_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698