OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 UI_BASE_MODELS_SIMPLE_COMBOBOX_MODEL_H_ | |
6 #define UI_BASE_MODELS_SIMPLE_COMBOBOX_MODEL_H_ | |
7 | |
8 #include "ui/base/models/combobox_model.h" | |
9 | |
10 #include <vector> | |
11 | |
12 namespace ui { | |
13 | |
14 // A simple data model for a combobox that takes string16 vectors as the items. | |
15 // An empty string will be a separator. | |
16 class UI_BASE_EXPORT SimpleComboboxModel : public ComboboxModel { | |
17 public: | |
18 explicit SimpleComboboxModel(const std::vector<base::string16>& items); | |
19 virtual ~SimpleComboboxModel() {} | |
sky
2014/06/18 16:57:19
Don't inline this.
hajimehoshi
2014/06/19 03:51:23
Done.
| |
20 | |
21 // ui::ComboboxModel: | |
22 virtual int GetItemCount() const OVERRIDE; | |
23 virtual base::string16 GetItemAt(int index) OVERRIDE; | |
24 virtual bool IsItemSeparatorAt(int index) OVERRIDE; | |
25 virtual int GetDefaultIndex() const OVERRIDE; | |
26 | |
27 private: | |
28 std::vector<base::string16> items_; | |
sky
2014/06/18 16:57:19
const
hajimehoshi
2014/06/19 03:51:23
Done.
| |
29 }; | |
sky
2014/06/18 16:57:19
DISALLOW_...
hajimehoshi
2014/06/19 03:51:23
Done.
| |
30 | |
31 } // namespace ui | |
32 | |
33 #endif // UI_BASE_MODELS_SIMPLE_COMBOBOX_MODEL_H_ | |
OLD | NEW |