| 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 f79cdd89d63dae424a9ad66b06d9d03829f2887c..4fc5850f148d821955e40fd30febf64aa14262d0 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,15 @@ 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) {
|
| + // Convert the thickness in the screen (dip) to the viewport
|
| + // by applying the invert of the viewport to screen scale.
|
| + // TODO(oshima): Introduce the screenToViewport(float) to avoid the rounding error.
|
| + IntRect inScreen(0, 0, 100, 0);
|
| + inScreen = hostWindow->viewportToScreen(inScreen);
|
| + thickness *= 100.f / inScreen.width();
|
| + }
|
| +
|
| Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
|
|
|
| m_currentPos = scrollableAreaCurrentPos();
|
|
|