| Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
|
| diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
|
| index 2e9004653d016bf95d71723fbfaed01b3bdb9c2b..2806ef9d003fac7ce4cf8bf1695da117664a8739 100644
|
| --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
|
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
|
| @@ -133,7 +133,7 @@ void ScrollbarThemeMacOverlayAPI::setNewPainterForScrollbar(ScrollbarThemeClient
|
| updateScrollbarOverlayStyle(scrollbar);
|
| }
|
|
|
| -ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(const ScrollbarThemeClient* scrollbar)
|
| +ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(const ScrollbarThemeClient* scrollbar) const
|
| {
|
| return [scrollbarPainterMap()->get(const_cast<ScrollbarThemeClient*>(scrollbar)).get() painter];
|
| }
|
| @@ -155,8 +155,13 @@ void ScrollbarThemeMacOverlayAPI::paintTrackBackground(GraphicsContext* context,
|
| [scrollbarPainter setEnabled:scrollbar->enabled()];
|
| [scrollbarPainter setBoundsSize: NSSizeFromCGSize(frameRect.size)];
|
|
|
| + CGFloat oldTrackAlpha = [scrollbarPainter trackAlpha];
|
| + [scrollbarPainter setTrackAlpha:1];
|
| +
|
| NSRect trackRect = NSMakeRect(0, 0, frameRect.size.width, frameRect.size.height);
|
| [scrollbarPainter drawKnobSlotInRect:trackRect highlight:NO];
|
| +
|
| + [scrollbarPainter setTrackAlpha:oldTrackAlpha];
|
| }
|
|
|
| void ScrollbarThemeMacOverlayAPI::paintThumb(GraphicsContext* context, const ScrollbarThemeClient* scrollbar, const IntRect& rect) {
|
| @@ -179,12 +184,17 @@ void ScrollbarThemeMacOverlayAPI::paintThumb(GraphicsContext* context, const Scr
|
| [scrollbarPainter setBoundsSize:NSSizeFromCGSize(rect.size())];
|
| [scrollbarPainter setDoubleValue:0];
|
| [scrollbarPainter setKnobProportion:1];
|
| +
|
| + CGFloat oldKnobAlpha = [scrollbarPainter knobAlpha];
|
| + [scrollbarPainter setKnobAlpha:1];
|
| +
|
| if (scrollbar->enabled())
|
| [scrollbarPainter drawKnob];
|
|
|
| // If this state is not set, then moving the cursor over the scrollbar area will only cause the
|
| // scrollbar to engorge when moved over the top of the scrollbar area.
|
| [scrollbarPainter setBoundsSize: NSSizeFromCGSize(scrollbar->frameRect().size())];
|
| + [scrollbarPainter setKnobAlpha:oldKnobAlpha];
|
| }
|
|
|
| int ScrollbarThemeMacOverlayAPI::scrollbarThickness(ScrollbarControlSize controlSize)
|
| @@ -266,5 +276,15 @@ void ScrollbarThemeMacOverlayAPI::updateEnabledState(const ScrollbarThemeClient*
|
| [painterForScrollbar(scrollbar) setEnabled:scrollbar->enabled()];
|
| }
|
|
|
| +float ScrollbarThemeMacOverlayAPI::trackOpacity(const ScrollbarThemeClient* scrollbar) const {
|
| + ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
|
| + return [scrollbarPainter trackAlpha];
|
| +}
|
| +
|
| +float ScrollbarThemeMacOverlayAPI::thumbOpacity(const ScrollbarThemeClient* scrollbar) const {
|
| + ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
|
| + return [scrollbarPainter knobAlpha];
|
| +}
|
| +
|
| } // namespace blink
|
|
|
|
|