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

Unified Diff: ui/native_theme/native_theme_base.cc

Issue 2006643004: Fix scrollbar buttons on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 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
Index: ui/native_theme/native_theme_base.cc
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index 548b4a5cf695869c665d8eee425948b31e0d60af..482037ea6513e271671bcfabf6129b18fc4c653d 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -115,10 +115,14 @@ gfx::Size NativeThemeBase::GetPartSize(Part part,
return gfx::Size(kCheckboxAndRadioWidth, kCheckboxAndRadioHeight);
case kScrollbarDownArrow:
case kScrollbarUpArrow:
- return gfx::Size(scrollbar_width_, scrollbar_button_length_);
+ if (HasScrollbarButtons())
+ return gfx::Size(scrollbar_width_, kDefaultScrollbarButtonLength);
+ return gfx::Size(0, 0);
case kScrollbarLeftArrow:
case kScrollbarRightArrow:
- return gfx::Size(scrollbar_button_length_, scrollbar_width_);
+ if (HasScrollbarButtons())
+ return gfx::Size(kDefaultScrollbarButtonLength, scrollbar_width_);
+ return gfx::Size(0, 0);
case kScrollbarHorizontalThumb:
// This matches Firefox on Linux.
return gfx::Size(2 * scrollbar_width_, scrollbar_width_);
@@ -221,7 +225,7 @@ void NativeThemeBase::Paint(SkCanvas* canvas,
case kScrollbarUpArrow:
case kScrollbarLeftArrow:
case kScrollbarRightArrow:
- if (scrollbar_button_length_ > 0)
+ if (HasScrollbarButtons())
PaintArrowButton(canvas, rect, part, state);
break;
case kScrollbarHorizontalThumb:
@@ -265,10 +269,7 @@ void NativeThemeBase::Paint(SkCanvas* canvas,
canvas->restore();
}
-NativeThemeBase::NativeThemeBase()
- : scrollbar_width_(kDefaultScrollbarWidth),
- scrollbar_button_length_(kDefaultScrollbarButtonLength) {
-}
+NativeThemeBase::NativeThemeBase() : scrollbar_width_(kDefaultScrollbarWidth) {}
NativeThemeBase::~NativeThemeBase() {
}
« ui/native_theme/native_theme_aura.cc ('K') | « ui/native_theme/native_theme_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698