| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 case NAME_BILLING_FULL: | 189 case NAME_BILLING_FULL: |
| 190 case NAME_FULL: | 190 case NAME_FULL: |
| 191 if (field) | 191 if (field) |
| 192 *field = ::i18n::addressinput::RECIPIENT; | 192 *field = ::i18n::addressinput::RECIPIENT; |
| 193 return true; | 193 return true; |
| 194 default: | 194 default: |
| 195 return false; | 195 return false; |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 bool CountryIsFullySupported(const std::string& country_code) { | |
| 200 DCHECK_EQ(2U, country_code.size()); | |
| 201 std::vector< ::i18n::addressinput::AddressUiComponent> components = | |
| 202 ::i18n::addressinput::BuildComponents( | |
| 203 country_code, g_browser_process->GetApplicationLocale(), NULL); | |
| 204 for (size_t i = 0; i < components.size(); ++i) { | |
| 205 if (components[i].field == ::i18n::addressinput::DEPENDENT_LOCALITY) | |
| 206 return false; | |
| 207 } | |
| 208 return true; | |
| 209 } | |
| 210 | |
| 211 } // namespace i18ninput | 199 } // namespace i18ninput |
| 212 } // namespace autofill | 200 } // namespace autofill |
| OLD | NEW |