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

Unified Diff: chrome/browser/ui/views/payments/preselected_combobox_model.h

Issue 2689363004: [Payments] Add combobox support to editors. (Closed)
Patch Set: addressed comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/preselected_combobox_model.h
diff --git a/chrome/browser/ui/views/payments/preselected_combobox_model.h b/chrome/browser/ui/views/payments/preselected_combobox_model.h
new file mode 100644
index 0000000000000000000000000000000000000000..56370f3c914cbb7110904376aa11630a86a3c0fb
--- /dev/null
+++ b/chrome/browser/ui/views/payments/preselected_combobox_model.h
@@ -0,0 +1,32 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PRESELECTED_COMBOBOX_MODEL_H_
+#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PRESELECTED_COMBOBOX_MODEL_H_
+
+#include "base/macros.h"
+#include "ui/base/models/simple_combobox_model.h"
please use gerrit instead 2017/02/16 14:52:19 #include <vector> #include "base/strings/string16.
Mathieu 2017/02/16 16:00:08 Done.
+
+namespace payments {
+
+// A simple data model for a combobox that takes a string16 vector as the items,
+// as well as the default selected index. An empty string is a separator.
+class PreselectedComboboxModel : public ui::SimpleComboboxModel {
+ public:
+ PreselectedComboboxModel(const std::vector<base::string16>& items,
+ int default_index);
+ ~PreselectedComboboxModel() override;
+
+ // ui::ComboboxModel:
+ int GetDefaultIndex() const override;
+
+ private:
+ const int default_index_;
+
+ DISALLOW_COPY_AND_ASSIGN(PreselectedComboboxModel);
+};
+
+} // namespace payments
+
+#endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PRESELECTED_COMBOBOX_MODEL_H_

Powered by Google App Engine
This is Rietveld 408576698