Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_models.cc

Issue 12328091: set a default country in the autofill dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ilya review 2 Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_models.h ('k') | chrome/browser/ui/autofill/country_combobox_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698