diff options
Diffstat (limited to 'chromium/ui/base/models/combobox_model.h')
-rw-r--r-- | chromium/ui/base/models/combobox_model.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/chromium/ui/base/models/combobox_model.h b/chromium/ui/base/models/combobox_model.h index 2fcd7b69029..994ac2bbef7 100644 --- a/chromium/ui/base/models/combobox_model.h +++ b/chromium/ui/base/models/combobox_model.h @@ -5,15 +5,16 @@ #ifndef UI_BASE_MODELS_COMBOBOX_MODEL_H_ #define UI_BASE_MODELS_COMBOBOX_MODEL_H_ +#include "base/component_export.h" #include "base/strings/string16.h" -#include "ui/base/ui_base_export.h" namespace ui { class ComboboxModelObserver; +class ImageModel; // A data model for a combo box. -class UI_BASE_EXPORT ComboboxModel { +class COMPONENT_EXPORT(UI_BASE) ComboboxModel { public: virtual ~ComboboxModel() {} @@ -21,11 +22,27 @@ class UI_BASE_EXPORT ComboboxModel { virtual int GetItemCount() const = 0; // Returns the string at the specified index. - virtual base::string16 GetItemAt(int index) = 0; + virtual base::string16 GetItemAt(int index) const = 0; + + // Returns the string to be shown in the dropdown for the item at |index|. By + // default, it returns GetItemAt(index). + virtual base::string16 GetDropDownTextAt(int index) const; + + // Returns the secondary string at the specified index. Secondary strings are + // displayed in a second line inside every menu item. + virtual base::string16 GetDropDownSecondaryTextAt(int index) const; + + // Gets the icon for the item at the specified index. ImageModel is empty if + // there is no icon. + virtual ImageModel GetIconAt(int index) const; + + // Gets the icon for the item at |index|. ImageModel is empty if there is no + // icon. By default, it returns GetIconAt(index). + virtual ImageModel GetDropDownIconAt(int index) const; // Should return true if the item at |index| is a non-selectable separator // item. - virtual bool IsItemSeparatorAt(int index); + virtual bool IsItemSeparatorAt(int index) const; // The index of the item that is selected by default (before user // interaction). |