Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| index a86da068c7f3476ad441ca7d09b13d5428fbc8d4..4d0b700da4bc67f026e3408b4010feb7d3bb4888 100644 |
| --- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| +++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| @@ -26,6 +26,7 @@ |
| #include "platform/scroll/Scrollbar.h" |
| #include <algorithm> |
| +#include "platform/HostWindow.h" |
| #include "platform/PlatformGestureEvent.h" |
| #include "platform/PlatformMouseEvent.h" |
| #include "platform/graphics/paint/CullRect.h" |
| @@ -40,17 +41,17 @@ |
| namespace blink { |
| -PassRefPtrWillBeRawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size) |
| +PassRefPtrWillBeRawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size, HostWindow* hostWindow) |
| { |
| - return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size)); |
| + return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size, hostWindow)); |
| } |
| PassRefPtrWillBeRawPtr<Scrollbar> Scrollbar::createForTesting(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size, ScrollbarTheme* theme) |
| { |
| - return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size, theme)); |
| + return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size, nullptr, theme)); |
| } |
| -Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* theme) |
| +Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, HostWindow* hostWindow, ScrollbarTheme* theme) |
| : m_scrollableArea(scrollableArea) |
| , m_orientation(orientation) |
| , m_controlSize(controlSize) |
| @@ -78,6 +79,12 @@ Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orient |
| // scrollbar thickness and use it when sizing scrollbars (rather than leaving one dimension of the scrollbar |
| // alone when sizing). |
| int thickness = m_theme.scrollbarThickness(controlSize); |
| + if (hostWindow) { |
| + IntRect tmp(0, 0, 100, 0); |
|
skobes
2016/01/07 21:49:10
Where does this "100" come from?
oshima
2016/01/09 00:58:39
It's picked as large enough number so that you can
skobes
2016/01/11 03:28:29
It would be much clearer to have an overload of vi
skobes
2016/01/11 03:30:52
Clarification: I meant something like HostWindow::
|
| + tmp = hostWindow->viewportToScreen(tmp); |
| + thickness *= 100.f / tmp.width(); |
| + } |
| + |
| Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); |
| m_currentPos = scrollableAreaCurrentPos(); |