| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/country_combobox_model.h" | 5 #include "chrome/browser/ui/autofill/country_combobox_model.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.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_country.h" | 10 #include "components/autofill/core/browser/autofill_country.h" |
| 11 #include "components/autofill/core/browser/personal_data_manager.h" | 11 #include "components/autofill/core/browser/personal_data_manager.h" |
| 12 #include "ui/base/l10n/l10n_util_collator.h" | 12 #include "ui/base/l10n/l10n_util_collator.h" |
| 13 #include "ui/base/models/combobox_model_observer.h" | 13 #include "ui/base/models/combobox_model_observer.h" |
| 14 | 14 |
| 15 // TODO(rouslan): Remove this check. http://crbug.com/337587 | 15 // TODO(rouslan): Remove this check. http://crbug.com/337587 |
| 16 #if defined(ENABLE_AUTOFILL_DIALOG) | 16 #if defined(ENABLE_AUTOFILL_DIALOG) |
| 17 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre
ss_ui.h" | 17 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui
.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace autofill { | 20 namespace autofill { |
| 21 | 21 |
| 22 CountryComboboxModel::CountryComboboxModel( | 22 CountryComboboxModel::CountryComboboxModel( |
| 23 const PersonalDataManager& manager, | 23 const PersonalDataManager& manager, |
| 24 const base::Callback<bool(const std::string&)>& filter) { | 24 const base::Callback<bool(const std::string&)>& filter) { |
| 25 // Insert the default country at the top as well as in the ordered list. | 25 // Insert the default country at the top as well as in the ordered list. |
| 26 std::string default_country_code = | 26 std::string default_country_code = |
| 27 manager.GetDefaultCountryCodeForNewAddress(); | 27 manager.GetDefaultCountryCodeForNewAddress(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 bool CountryComboboxModel::IsItemSeparatorAt(int index) { | 77 bool CountryComboboxModel::IsItemSeparatorAt(int index) { |
| 78 return !countries_[index]; | 78 return !countries_[index]; |
| 79 } | 79 } |
| 80 | 80 |
| 81 std::string CountryComboboxModel::GetDefaultCountryCode() const { | 81 std::string CountryComboboxModel::GetDefaultCountryCode() const { |
| 82 return countries_[GetDefaultIndex()]->country_code(); | 82 return countries_[GetDefaultIndex()]->country_code(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace autofill | 85 } // namespace autofill |
| OLD | NEW |