| 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/autofill_dialog_models.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 6 | 6 |
| 7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 YearComboboxModel::~YearComboboxModel() {} | 94 YearComboboxModel::~YearComboboxModel() {} |
| 95 | 95 |
| 96 int YearComboboxModel::GetItemCount() const { | 96 int YearComboboxModel::GetItemCount() const { |
| 97 return 10; | 97 return 10; |
| 98 } | 98 } |
| 99 | 99 |
| 100 string16 YearComboboxModel::GetItemAt(int index) { | 100 string16 YearComboboxModel::GetItemAt(int index) { |
| 101 return base::IntToString16(this_year_ + index); | 101 return base::IntToString16(this_year_ + index); |
| 102 } | 102 } |
| 103 | 103 |
| 104 // CountryComboboxModel -------------------------------------------------------- | |
| 105 | |
| 106 CountryComboboxModel::CountryComboboxModel() { | |
| 107 AutofillCountry::GetAvailableCountries(&country_codes_); | |
| 108 } | |
| 109 | |
| 110 CountryComboboxModel::~CountryComboboxModel() {} | |
| 111 | |
| 112 int CountryComboboxModel::GetItemCount() const { | |
| 113 return country_codes_.size(); | |
| 114 } | |
| 115 | |
| 116 string16 CountryComboboxModel::GetItemAt(int index) { | |
| 117 std::string app_locale = AutofillCountry::ApplicationLocale(); | |
| 118 const AutofillCountry country(country_codes_[index], app_locale); | |
| 119 return country.name(); | |
| 120 } | |
| 121 | |
| 122 } // autofill | 104 } // autofill |
| OLD | NEW |