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.
5 #ifndef UI_BASE_MODELS_SIMPLE_COMBOBOX_MODEL_H_
6 #define UI_BASE_MODELS_SIMPLE_COMBOBOX_MODEL_H_
8 #include "ui/base/models/combobox_model.h"
14 // A simple data model for a combobox that takes a string16 vector as the items.
15 // An empty string will be a separator.
16 class UI_BASE_EXPORT SimpleComboboxModel
: public ComboboxModel
{
18 explicit SimpleComboboxModel(const std::vector
<base::string16
>& items
);
19 ~SimpleComboboxModel() override
;
22 int GetItemCount() const override
;
23 base::string16
GetItemAt(int index
) override
;
24 bool IsItemSeparatorAt(int index
) override
;
25 int GetDefaultIndex() const override
;
28 const std::vector
<base::string16
> items_
;
30 DISALLOW_COPY_AND_ASSIGN(SimpleComboboxModel
);
35 #endif // UI_BASE_MODELS_SIMPLE_COMBOBOX_MODEL_H_