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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_models.h

Issue 2918133002: [Merge M60][Payments] Refactor the year and month combobox models and preselect. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/autofill/autofill_dialog_models.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/autofill_dialog_models.h
diff --git a/chrome/browser/ui/autofill/autofill_dialog_models.h b/chrome/browser/ui/autofill/autofill_dialog_models.h
index 0fec489b69cee7f360808038e481b9c8b7fba5ef..f2f00e71a0a1e2891e440f34fe540a0246d7df47 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_models.h
+++ b/chrome/browser/ui/autofill/autofill_dialog_models.h
@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/strings/string16.h"
#include "ui/base/models/combobox_model.h"
+#include "ui/base/models/simple_combobox_model.h"
#include "ui/base/models/simple_menu_model.h"
namespace autofill {
@@ -114,8 +115,6 @@ class MonthComboboxModel : public ui::ComboboxModel {
MonthComboboxModel();
~MonthComboboxModel() override;
- static base::string16 FormatMonth(int index);
-
// ui::Combobox implementation:
int GetItemCount() const override;
base::string16 GetItemAt(int index) override;
@@ -125,19 +124,15 @@ class MonthComboboxModel : public ui::ComboboxModel {
};
// A model for years between now and a decade hence.
-class YearComboboxModel : public ui::ComboboxModel {
+class YearComboboxModel : public ui::SimpleComboboxModel {
public:
- YearComboboxModel();
+ // If |additional_year| is not in the year range initially in this model
+ // [current year, current year + 9], this will add |additional_year| to the
+ // model. Passing 0 has no effect.
+ explicit YearComboboxModel(int additional_year = 0);
~YearComboboxModel() override;
- // ui::Combobox implementation:
- int GetItemCount() const override;
- base::string16 GetItemAt(int index) override;
-
private:
- // The current year (e.g., 2012).
- int this_year_;
-
DISALLOW_COPY_AND_ASSIGN(YearComboboxModel);
};
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/autofill/autofill_dialog_models.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698