summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 05:50:09 +0000
committerdbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 05:50:09 +0000
commit6e43ab4e93d620483d30259bf0a932d3e1f3bb2e (patch)
tree279d52611e64895e99879742bc1c954574982ad6
parent054af568101d3e6d3cfbc596dc96aab88c39e822 (diff)
downloadchromium_src-6e43ab4e93d620483d30259bf0a932d3e1f3bb2e.zip
chromium_src-6e43ab4e93d620483d30259bf0a932d3e1f3bb2e.tar.gz
chromium_src-6e43ab4e93d620483d30259bf0a932d3e1f3bb2e.tar.bz2
Add back AutofillType::server_type() to fix input filling issues on
requestAutocomplete() dialog. BUG=321887 R=isherman@chromium.org Review URL: https://codereview.chromium.org/81853003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237266 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/autofill/data_model_wrapper.cc3
-rw-r--r--chrome/browser/ui/autofill/data_model_wrapper_unittest.cc23
-rw-r--r--components/autofill/core/browser/autofill_type.h1
3 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/ui/autofill/data_model_wrapper.cc b/chrome/browser/ui/autofill/data_model_wrapper.cc
index dd136ec..eba59c9 100644
--- a/chrome/browser/ui/autofill/data_model_wrapper.cc
+++ b/chrome/browser/ui/autofill/data_model_wrapper.cc
@@ -361,10 +361,9 @@ DetailOutputWrapper::DetailOutputWrapper(const DetailOutputMap& outputs)
DetailOutputWrapper::~DetailOutputWrapper() {}
base::string16 DetailOutputWrapper::GetInfo(const AutofillType& type) const {
- ServerFieldType storable_type = type.GetStorableType();
for (DetailOutputMap::const_iterator it = outputs_.begin();
it != outputs_.end(); ++it) {
- if (storable_type == AutofillType(it->first->type).GetStorableType())
+ if (type.server_type() == it->first->type)
return it->second;
}
return base::string16();
diff --git a/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc b/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc
index 1deb759..05050cd 100644
--- a/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc
+++ b/chrome/browser/ui/autofill/data_model_wrapper_unittest.cc
@@ -168,4 +168,27 @@ TEST(DataModelWrapperTest, GetDisplayPhoneNumber) {
}
+TEST(DetailOutputWrapperTest, BothShippingAndBillingCanCoexist) {
+ DetailInputs inputs;
+
+ DetailInput billing_street;
+ billing_street.type = ADDRESS_BILLING_STREET_ADDRESS;
+ inputs.push_back(billing_street);
+
+ DetailInput shipping_street;
+ shipping_street.type = ADDRESS_HOME_STREET_ADDRESS;
+ inputs.push_back(shipping_street);
+
+ const DetailInputs const_inputs(inputs);
+
+ DetailOutputMap outputs;
+ outputs[&const_inputs[0]] = ASCIIToUTF16("123 billing street");
+ outputs[&const_inputs[1]] = ASCIIToUTF16("123 shipping street");
+
+ DetailOutputWrapper wrapper(outputs);
+ wrapper.FillInputs(&inputs);
+
+ EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value);
+}
+
} // namespace autofill
diff --git a/components/autofill/core/browser/autofill_type.h b/components/autofill/core/browser/autofill_type.h
index 70668ae..2502136 100644
--- a/components/autofill/core/browser/autofill_type.h
+++ b/components/autofill/core/browser/autofill_type.h
@@ -20,6 +20,7 @@ class AutofillType {
AutofillType(const AutofillType& autofill_type);
AutofillType& operator=(const AutofillType& autofill_type);
+ ServerFieldType server_type() const { return server_type_; }
HtmlFieldType html_type() const { return html_type_; }
FieldTypeGroup group() const;