summaryrefslogtreecommitdiff
path: root/chromium/ui/base/models/combobox_model.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/base/models/combobox_model.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/base/models/combobox_model.h')
-rw-r--r--chromium/ui/base/models/combobox_model.h25
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).