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

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

Issue 13607006: rAc: don't clobber user input when accepting autofill popup suggestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: a couple more bugs Created 7 years, 8 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/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 MonthComboboxModel::~MonthComboboxModel() {} 189 MonthComboboxModel::~MonthComboboxModel() {}
190 190
191 int MonthComboboxModel::GetItemCount() const { 191 int MonthComboboxModel::GetItemCount() const {
192 // 12 months plus the empty entry. 192 // 12 months plus the empty entry.
193 return 13; 193 return 13;
194 } 194 }
195 195
196 // static 196 // static
197 string16 MonthComboboxModel::FormatMonth(int index) { 197 string16 MonthComboboxModel::FormatMonth(int index) {
198 return ASCIIToUTF16(base::StringPrintf("%2d", index)); 198 return ASCIIToUTF16(base::StringPrintf("%.2d", index));
Evan Stade 2013/04/05 23:24:01 isherman: NB
199 } 199 }
200 200
201 string16 MonthComboboxModel::GetItemAt(int index) { 201 string16 MonthComboboxModel::GetItemAt(int index) {
202 return index == 0 ? string16() : FormatMonth(index); 202 return index == 0 ? string16() : FormatMonth(index);
203 } 203 }
204 204
205 // YearComboboxModel ----------------------------------------------------------- 205 // YearComboboxModel -----------------------------------------------------------
206 206
207 YearComboboxModel::YearComboboxModel() : this_year_(0) { 207 YearComboboxModel::YearComboboxModel() : this_year_(0) {
208 base::Time time = base::Time::Now(); 208 base::Time time = base::Time::Now();
(...skipping 10 matching lines...) Expand all
219 } 219 }
220 220
221 string16 YearComboboxModel::GetItemAt(int index) { 221 string16 YearComboboxModel::GetItemAt(int index) {
222 if (index == 0) 222 if (index == 0)
223 return string16(); 223 return string16();
224 224
225 return base::IntToString16(this_year_ + index - 1); 225 return base::IntToString16(this_year_ + index - 1);
226 } 226 }
227 227
228 } // autofill 228 } // autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698