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

Unified Diff: Source/web/WebInputEventConversion.cpp

Issue 23187005: [DevTools] Use device metrics emulation implemented in content. (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Another rebase Created 7 years, 2 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
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebInputEventConversion.cpp
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp
index 47a1c5f812c1461cbe45d37235dd58cb587b59b3..d25d0ef60b5c608af7671789e2109ac2ea3e42b9 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -54,7 +54,7 @@ namespace WebKit {
static const double millisPerSecond = 1000.0;
-static float widgetScaleFactor(const Widget* widget)
+static float widgetInputEventsScaleFactor(const Widget* widget)
{
if (!widget)
return 1;
@@ -63,14 +63,14 @@ static float widgetScaleFactor(const Widget* widget)
if (!rootView)
return 1;
- return rootView->visibleContentScaleFactor();
+ return rootView->inputEventsScaleFactor();
}
// MakePlatformMouseEvent -----------------------------------------------------
PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMouseEvent& e)
{
- float scale = widgetScaleFactor(widget);
+ float scale = widgetInputEventsScaleFactor(widget);
// FIXME: Widget is always toplevel, unless it's a popup. We may be able
// to get rid of this once we abstract popups into a WebKit API.
m_position = widget->convertFromContainingWindow(IntPoint(e.x / scale, e.y / scale));
@@ -115,7 +115,7 @@ PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMo
PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMouseWheelEvent& e)
{
- float scale = widgetScaleFactor(widget);
+ float scale = widgetInputEventsScaleFactor(widget);
m_position = widget->convertFromContainingWindow(IntPoint(e.x / scale, e.y / scale));
m_globalPosition = IntPoint(e.globalX, e.globalY);
m_deltaX = e.deltaX;
@@ -152,7 +152,7 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo
PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const WebGestureEvent& e)
{
- float scale = widgetScaleFactor(widget);
+ float scale = widgetInputEventsScaleFactor(widget);
switch (e.type) {
case WebInputEvent::GestureScrollBegin:
m_type = PlatformEvent::GestureScrollBegin;
@@ -383,7 +383,7 @@ inline WebTouchPoint::State toWebTouchPointState(const AtomicString& type)
PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTouchPoint& point)
{
- float scale = widgetScaleFactor(widget);
+ float scale = widgetInputEventsScaleFactor(widget);
m_id = point.id;
m_state = toPlatformTouchPointState(point.state);
m_pos = widget->convertFromContainingWindow(IntPoint(point.position.x / scale, point.position.y / scale));
@@ -566,7 +566,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const WebCore::Widget* widget, const
// FIXME: Widget is always toplevel, unless it's a popup. We may be able
// to get rid of this once we abstract popups into a WebKit API.
IntPoint position = widget->convertToContainingWindow(event.position());
- float scale = widgetScaleFactor(widget);
+ float scale = widgetInputEventsScaleFactor(widget);
position.scale(scale, scale);
x = position.x();
y = position.y();
« no previous file with comments | « Source/web/WebFrameImpl.cpp ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698