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

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

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: fix test 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
Index: ui/views/controls/combobox/combobox.cc
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index 3d7cfd1e26585dae22ab9fd8f8cfe5d876987304..f4fcfbec6bbf94d12302633a3a2dc45c85e83ddf 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -366,6 +366,7 @@ Combobox::Combobox(ui::ComboboxModel* model, Style style)
menu_model_adapter_(new ComboboxMenuModelAdapter(this, model)),
text_button_(new TransparentButton(this)),
arrow_button_(new TransparentButton(this)),
+ size_to_largest_label_(style_ == STYLE_NORMAL),
weak_ptr_factory_(this) {
ModelChanged();
#if defined(OS_MACOSX)
@@ -878,7 +879,7 @@ gfx::Size Combobox::GetContentSize() const {
if (model_->IsItemSeparatorAt(i))
continue;
- if (style_ != STYLE_ACTION || i == selected_index_) {
+ if (size_to_largest_label_ || i == selected_index_) {
width = std::max(
width,
gfx::GetStringWidth(menu_model_adapter_->GetLabelAt(i), font_list));
« ui/views/controls/combobox/combobox.h ('K') | « ui/views/controls/combobox/combobox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698