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

Side by Side Diff: chrome/browser/ui/views/payments/preselected_combobox_model.h

Issue 2689363004: [Payments] Add combobox support to editors. (Closed)
Patch Set: re-enable test, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PRESELECTED_COMBOBOX_MODEL_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PRESELECTED_COMBOBOX_MODEL_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/strings/string16.h"
12 #include "ui/base/models/simple_combobox_model.h"
13
14 namespace payments {
15
16 // A simple data model for a combobox that takes a string16 vector as the items,
17 // as well as the default selected index. An empty string is a separator.
18 class PreselectedComboboxModel : public ui::SimpleComboboxModel {
19 public:
20 PreselectedComboboxModel(const std::vector<base::string16>& items,
21 int default_index);
22 ~PreselectedComboboxModel() override;
23
24 // ui::ComboboxModel:
25 int GetDefaultIndex() const override;
26
27 private:
28 const int default_index_;
29
30 DISALLOW_COPY_AND_ASSIGN(PreselectedComboboxModel);
31 };
32
33 } // namespace payments
34
35 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PRESELECTED_COMBOBOX_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698