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

Unified Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp

Issue 1560403002: Scale scrollbar in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: 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();

Powered by Google App Engine
This is Rietveld 408576698