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

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

Issue 2069733002: MD - Use real comboboxes in website settings popup. Hide borders (but (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 6 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/views/controls/button/label_button.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 a3112c7eb9cde23f28b21540bd644672fe5810f3..5cd44549de00c5b340a73098ad130a72dd216625 100644
--- a/ui/views/controls/combobox/combobox.h
+++ b/ui/views/controls/combobox/combobox.h
@@ -105,6 +105,11 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// Overriden from ButtonListener:
void ButtonPressed(Button* sender, const ui::Event& event) override;
+ protected:
+ void set_size_to_largest_label(bool size_to_largest_label) {
+ size_to_largest_label_ = size_to_largest_label;
+ }
+
private:
friend class test::ComboboxTestApi;
@@ -204,6 +209,11 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// The image to be drawn for this combobox's arrow.
gfx::ImageSkia arrow_image_;
+ // When true, the size of contents is defined by the selected label.
+ // Otherwise, it's defined by the widest label in the menu. If this is set to
+ // true, the parent view must relayout in ChildPreferredSizeChanged().
+ bool size_to_largest_label_;
+
// Used for making calbacks.
base::WeakPtrFactory<Combobox> weak_ptr_factory_;
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698