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

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

Issue 2826313006: views: remove PlatformStyle combobox hooks (Closed)
Patch Set: Created 3 years, 8 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 24c51702b2d11798c62274c4add4f29ea5629a8b..3e908d1a92c112841ff015bd5289524f0d8d8799 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -452,7 +452,8 @@ Combobox::Combobox(ui::ComboboxModel* model, Style style)
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
} else {
- arrow_image_ = PlatformStyle::CreateComboboxArrow(enabled(), style);
+ arrow_image_ = *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ IDR_MENU_DROPARROW);
}
}
@@ -550,12 +551,6 @@ void Combobox::Layout() {
arrow_button_->SetBounds(arrow_button_x, 0, arrow_button_width, height());
}
-void Combobox::OnEnabledChanged() {
- View::OnEnabledChanged();
- if (!UseMd())
- arrow_image_ = PlatformStyle::CreateComboboxArrow(enabled(), style_);
-}
-
void Combobox::OnNativeThemeChanged(const ui::NativeTheme* theme) {
if (!UseMd())
return;
@@ -1014,8 +1009,8 @@ PrefixSelector* Combobox::GetPrefixSelector() {
int Combobox::GetArrowContainerWidth() const {
const int kMdPaddingWidth = 8;
tapted 2017/04/21 00:31:10 nit: constexpr for these
Elly Fong-Jones 2017/04/21 15:23:24 Done.
- int arrow_pad = UseMd() ? kMdPaddingWidth
- : PlatformStyle::kComboboxNormalArrowPadding;
+ const int kNormalPaddingWidth = 7;
+ int arrow_pad = UseMd() ? kMdPaddingWidth : kNormalPaddingWidth;
int padding = style_ == STYLE_NORMAL
? arrow_pad * 2
: kActionLeftPadding + kActionRightPadding;

Powered by Google App Engine
This is Rietveld 408576698