| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h" |
| 6 | 6 |
| 7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "components/autofill/core/browser/address_i18n.h" | 10 #include "components/autofill/core/browser/address_i18n.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const std::string& country_code, | 53 const std::string& country_code, |
| 54 DetailInputs* inputs, | 54 DetailInputs* inputs, |
| 55 std::string* language_code) { | 55 std::string* language_code) { |
| 56 const std::vector<AddressUiComponent>& components( | 56 const std::vector<AddressUiComponent>& components( |
| 57 BuildComponents(country_code, language_code)); | 57 BuildComponents(country_code, language_code)); |
| 58 | 58 |
| 59 const bool billing = address_type == common::ADDRESS_TYPE_BILLING; | 59 const bool billing = address_type == common::ADDRESS_TYPE_BILLING; |
| 60 | 60 |
| 61 for (size_t i = 0; i < components.size(); ++i) { | 61 for (size_t i = 0; i < components.size(); ++i) { |
| 62 const AddressUiComponent& component = components[i]; | 62 const AddressUiComponent& component = components[i]; |
| 63 // Interactive autofill dialog does not display organization. |
| 64 if (component.field == ::i18n::addressinput::ORGANIZATION) |
| 65 continue; |
| 63 ServerFieldType server_type = i18n::TypeForField(component.field, billing); | 66 ServerFieldType server_type = i18n::TypeForField(component.field, billing); |
| 64 DetailInput::Length length = LengthFromHint(component.length_hint); | 67 DetailInput::Length length = LengthFromHint(component.length_hint); |
| 65 base::string16 placeholder = base::UTF8ToUTF16(component.name); | 68 base::string16 placeholder = base::UTF8ToUTF16(component.name); |
| 66 DetailInput input = { length, server_type, placeholder }; | 69 DetailInput input = { length, server_type, placeholder }; |
| 67 inputs->push_back(input); | 70 inputs->push_back(input); |
| 68 } | 71 } |
| 69 | 72 |
| 70 ServerFieldType server_type = | 73 ServerFieldType server_type = |
| 71 billing ? ADDRESS_BILLING_COUNTRY : ADDRESS_HOME_COUNTRY; | 74 billing ? ADDRESS_BILLING_COUNTRY : ADDRESS_HOME_COUNTRY; |
| 72 base::string16 placeholder_text = | 75 base::string16 placeholder_text = |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 app_locale).empty()) { | 116 app_locale).empty()) { |
| 114 return false; | 117 return false; |
| 115 } | 118 } |
| 116 } | 119 } |
| 117 | 120 |
| 118 return true; | 121 return true; |
| 119 } | 122 } |
| 120 | 123 |
| 121 } // namespace i18ninput | 124 } // namespace i18ninput |
| 122 } // namespace autofill | 125 } // namespace autofill |
| OLD | NEW |