Chromium Code Reviews| Index: ui/native_theme/native_theme_aura.cc |
| diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc |
| index 76283878e06a13f8cb77b8adbc90799dfea2aa28..bbe1e7942a614ca6fa031b39159f04480552d7f2 100644 |
| --- a/ui/native_theme/native_theme_aura.cc |
| +++ b/ui/native_theme/native_theme_aura.cc |
| @@ -186,7 +186,7 @@ void NativeThemeAura::PaintScrollbarThumb( |
| Part part, |
| State state, |
| const gfx::Rect& rect, |
| - ScrollbarOverlayColorTheme theme) const { |
| + const NativeTheme::ScrollbarThumbExtraParams& params) const { |
| // Do not paint if state is disabled. |
| if (state == kDisabled) |
| return; |
| @@ -212,7 +212,7 @@ void NativeThemeAura::PaintScrollbarThumb( |
| constexpr SkColor kOverlayScrollbarStrokeColor[] = {SK_ColorWHITE, |
| SK_ColorBLACK}; |
| - thumb_color = kOverlayScrollbarThumbColor[theme]; |
| + thumb_color = kOverlayScrollbarThumbColor[params.scrollbar_theme]; |
| SkAlpha stroke_alpha = SK_AlphaTRANSPARENT; |
| switch (state) { |
| @@ -240,8 +240,8 @@ void NativeThemeAura::PaintScrollbarThumb( |
| // In overlay mode, draw a stroke (border). |
| constexpr int kStrokeWidth = kOverlayScrollbarStrokeWidth; |
| cc::PaintFlags flags; |
| - flags.setColor( |
| - SkColorSetA(kOverlayScrollbarStrokeColor[theme], stroke_alpha)); |
| + flags.setColor(SkColorSetA( |
| + kOverlayScrollbarStrokeColor[params.scrollbar_theme], stroke_alpha)); |
| flags.setStyle(cc::PaintFlags::kStroke_Style); |
| flags.setStrokeWidth(kStrokeWidth); |
| @@ -250,8 +250,15 @@ void NativeThemeAura::PaintScrollbarThumb( |
| stroke_rect.Inset(kHalfStrokeWidth, kHalfStrokeWidth); |
| canvas->drawRect(gfx::RectFToSkRect(stroke_rect), flags); |
| - // Inset the all the edges edges so we fill-in the stroke below. |
| - thumb_rect.Inset(kStrokeWidth, kStrokeWidth); |
| + // The edge to which the scrollbar is attached shouldn't have a border. |
|
bokan
2017/03/24 18:06:12
Please keep the comment this is currently replacin
|
| + if (part == NativeTheme::kScrollbarVerticalThumb) { |
| + if (params.isLeftVerticalScrollbar) |
| + thumb_rect.Inset(0, kStrokeWidth, kStrokeWidth, kStrokeWidth); |
| + else |
| + thumb_rect.Inset(kStrokeWidth, kStrokeWidth, 0, kStrokeWidth); |
| + } else { |
| + thumb_rect.Inset(kStrokeWidth, kStrokeWidth, kStrokeWidth, 0); |
| + } |
| } else { |
| switch (state) { |
| case NativeTheme::kDisabled: |