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

Unified Diff: ui/views/controls/combobox/combobox.h

Issue 1971333002: Views: factor out Combobox background and const-ify style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ios build break Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/scoped_canvas.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.h
diff --git a/ui/views/controls/combobox/combobox.h b/ui/views/controls/combobox/combobox.h
index 2705f7e22cc57e836ec64d03223a41bce479a585..a3112c7eb9cde23f28b21540bd644672fe5810f3 100644
--- a/ui/views/controls/combobox/combobox.h
+++ b/ui/views/controls/combobox/combobox.h
@@ -53,7 +53,7 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
static const char kViewClassName[];
// |model| is not owned by the combobox.
- explicit Combobox(ui::ComboboxModel* model);
+ explicit Combobox(ui::ComboboxModel* model, Style style = STYLE_NORMAL);
~Combobox() override;
static const gfx::FontList& GetFontList();
@@ -61,8 +61,6 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// Sets the listener which will be called when a selection has been made.
void set_listener(ComboboxListener* listener) { listener_ = listener; }
- void SetStyle(Style style);
-
// Informs the combobox that its model changed.
void ModelChanged();
@@ -85,10 +83,6 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
void SetInvalid(bool invalid);
bool invalid() const { return invalid_; }
- // Returns the width of the arrow button component of the combobox: the arrow
- // button itself, and the padding on either side of it.
- int GetArrowButtonWidth() const;
-
// Overridden from View:
gfx::Size GetPreferredSize() const override;
const char* GetClassName() const override;
@@ -100,6 +94,7 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
void OnBlur() override;
void GetAccessibleState(ui::AXViewState* state) override;
void Layout() override;
+ void OnEnabledChanged() override;
// Overridden from PrefixDelegate:
int GetRowCount() override;
@@ -148,11 +143,14 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
PrefixSelector* GetPrefixSelector();
+ // Returns the width of the combobox's arrow container.
+ int GetArrowContainerWidth() const;
+
// Our model. Not owned.
ui::ComboboxModel* model_;
// The visual style of this combobox.
- Style style_;
+ const Style style_;
// Our listener. Not owned. Notified when the selected index change.
ComboboxListener* listener_;
@@ -203,6 +201,9 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// destroyed.
std::unique_ptr<views::MenuRunner> menu_runner_;
+ // The image to be drawn for this combobox's arrow.
+ gfx::ImageSkia arrow_image_;
+
// Used for making calbacks.
base::WeakPtrFactory<Combobox> weak_ptr_factory_;
« no previous file with comments | « ui/gfx/scoped_canvas.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698