| 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/autofill_profile.h" | 10 #include "components/autofill/core/browser/autofill_profile.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (hint == AddressUiComponent::HINT_SHORT) | 31 if (hint == AddressUiComponent::HINT_SHORT) |
| 32 return DetailInput::SHORT; | 32 return DetailInput::SHORT; |
| 33 DCHECK_EQ(hint, AddressUiComponent::HINT_LONG); | 33 DCHECK_EQ(hint, AddressUiComponent::HINT_LONG); |
| 34 return DetailInput::LONG; | 34 return DetailInput::LONG; |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 void BuildAddressInputs(common::AddressType address_type, | 39 void BuildAddressInputs(common::AddressType address_type, |
| 40 const std::string& country_code, | 40 const std::string& country_code, |
| 41 DetailInputs* inputs) { | 41 DetailInputs* inputs, |
| 42 // TODO(rouslan): Store the language code for the autofill profile. | 42 std::string* languge_code) { |
| 43 // http://crbug.com/354955 | |
| 44 std::vector<AddressUiComponent> components( | 43 std::vector<AddressUiComponent> components( |
| 45 ::i18n::addressinput::BuildComponents( | 44 ::i18n::addressinput::BuildComponents( |
| 46 country_code, g_browser_process->GetApplicationLocale(), NULL)); | 45 country_code, g_browser_process->GetApplicationLocale(), |
| 46 languge_code)); |
| 47 | 47 |
| 48 const bool billing = address_type == common::ADDRESS_TYPE_BILLING; | 48 const bool billing = address_type == common::ADDRESS_TYPE_BILLING; |
| 49 | 49 |
| 50 for (size_t i = 0; i < components.size(); ++i) { | 50 for (size_t i = 0; i < components.size(); ++i) { |
| 51 const AddressUiComponent& component = components[i]; | 51 const AddressUiComponent& component = components[i]; |
| 52 if (component.field == ::i18n::addressinput::ORGANIZATION) { | 52 if (component.field == ::i18n::addressinput::ORGANIZATION) { |
| 53 // TODO(dbeam): figure out when we actually need this. | 53 // TODO(dbeam): figure out when we actually need this. |
| 54 continue; | 54 continue; |
| 55 } | 55 } |
| 56 | 56 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 country_code, g_browser_process->GetApplicationLocale(), NULL); | 250 country_code, g_browser_process->GetApplicationLocale(), NULL); |
| 251 for (size_t i = 0; i < components.size(); ++i) { | 251 for (size_t i = 0; i < components.size(); ++i) { |
| 252 if (components[i].field == ::i18n::addressinput::DEPENDENT_LOCALITY) | 252 if (components[i].field == ::i18n::addressinput::DEPENDENT_LOCALITY) |
| 253 return false; | 253 return false; |
| 254 } | 254 } |
| 255 return true; | 255 return true; |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace i18ninput | 258 } // namespace i18ninput |
| 259 } // namespace autofill | 259 } // namespace autofill |
| OLD | NEW |