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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 address_data->sorting_code = UTF16ToUTF8( | 191 address_data->sorting_code = UTF16ToUTF8( |
192 get_info.Run(AutofillType(ADDRESS_HOME_SORTING_CODE))); | 192 get_info.Run(AutofillType(ADDRESS_HOME_SORTING_CODE))); |
193 address_data->postal_code = UTF16ToUTF8( | 193 address_data->postal_code = UTF16ToUTF8( |
194 get_info.Run(AutofillType(ADDRESS_HOME_ZIP))); | 194 get_info.Run(AutofillType(ADDRESS_HOME_ZIP))); |
195 base::SplitString( | 195 base::SplitString( |
196 UTF16ToUTF8(get_info.Run(AutofillType(ADDRESS_HOME_STREET_ADDRESS))), | 196 UTF16ToUTF8(get_info.Run(AutofillType(ADDRESS_HOME_STREET_ADDRESS))), |
197 '\n', | 197 '\n', |
198 &address_data->address_lines); | 198 &address_data->address_lines); |
199 } | 199 } |
200 | 200 |
201 bool CountryIsFullySupported(const std::string& country_code) { | |
202 DCHECK_EQ(2U, country_code.size()); | |
203 std::vector<::i18n::addressinput::AddressUiComponent> components = | |
204 ::i18n::addressinput::BuildComponents(country_code); | |
205 for (size_t i = 0; i < components.size(); ++i) { | |
206 if (components[i].field == ::i18n::addressinput::DEPENDENT_LOCALITY) | |
please use gerrit instead
2014/02/19 20:09:13
nit: add a "TODO(dbeam): Enable countries with DEP
Dan Beam
2014/02/19 20:16:53
Done.
| |
207 return false; | |
208 } | |
209 return true; | |
210 } | |
211 | |
201 } // namespace i18ninput | 212 } // namespace i18ninput |
202 } // namespace autofill | 213 } // namespace autofill |
OLD | NEW |