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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Add missing copyright on new file Created 4 years 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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index f7bc3458e2db634245d22949e61f6a50f92e6a75..c9d70cd9d7880368d10f7bdd97588d218000e8b9 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -98,7 +98,6 @@
#include "platform/Cursor.h"
#include "platform/Histogram.h"
#include "platform/KeyboardCodes.h"
-#include "platform/PlatformGestureEvent.h"
#include "platform/PlatformMouseEvent.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/UserGestureIndicator.h"
@@ -728,14 +727,14 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
mainFrameImpl()->frameWidget()->scheduleAnimation();
eventResult = WebInputEventResult::HandledSystem;
+ WebGestureEvent scaledEvent =
+ TransformWebGestureEvent(mainFrameImpl()->frameView(), event);
// Plugins may need to see GestureFlingStart to balance
// GestureScrollBegin (since the former replaces GestureScrollEnd when
// transitioning to a fling).
- PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(),
- event);
// TODO(dtapuska): Why isn't the response used?
mainFrameImpl()->frame()->eventHandler().handleGestureScrollEvent(
- platformEvent);
+ scaledEvent);
m_client->didHandleGestureEvent(event, eventCancelled);
return WebInputEventResult::HandledSystem;
@@ -750,8 +749,8 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
break;
}
- PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(),
- event);
+ WebGestureEvent scaledEvent =
+ TransformWebGestureEvent(mainFrameImpl()->frameView(), event);
// Special handling for double tap and scroll events as we don't want to
// hit test for them.
@@ -760,7 +759,8 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
if (m_webSettings->doubleTapToZoomEnabled() &&
minimumPageScaleFactor() != maximumPageScaleFactor()) {
m_client->cancelScheduledContentIntents();
- animateDoubleTapZoom(platformEvent.position());
+ animateDoubleTapZoom(
+ flooredIntPoint(scaledEvent.positionInRootFrame()));
}
// GestureDoubleTap is currently only used by Android for zooming. For
// WebCore, GestureTap with tap count = 2 is used instead. So we drop
@@ -780,7 +780,7 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
// other gesture events.
eventResult =
mainFrameImpl()->frame()->eventHandler().handleGestureScrollEvent(
- platformEvent);
+ scaledEvent);
m_client->didHandleGestureEvent(event, eventCancelled);
return eventResult;
case WebInputEvent::GesturePinchBegin:
@@ -795,7 +795,7 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
// event type.
GestureEventWithHitTestResults targetedEvent =
m_page->deprecatedLocalMainFrame()->eventHandler().targetGestureEvent(
- platformEvent);
+ scaledEvent);
// Handle link highlighting outside the main switch to avoid getting lost in
// the complicated set of cases handled below.
@@ -1957,17 +1957,8 @@ void WebViewImpl::beginFrame(double lastFrameTimeMonotonic) {
WebGestureDevice lastFlingSourceDevice = m_flingSourceDevice;
endActiveFlingAnimation();
- PlatformGestureEvent endScrollEvent(
- PlatformEvent::GestureScrollEnd, m_positionOnFlingStart,
- m_globalPositionOnFlingStart, IntSize(), TimeTicks(),
- PlatformEvent::NoModifiers,
- lastFlingSourceDevice == WebGestureDeviceTouchpad
- ? PlatformGestureSourceTouchpad
- : PlatformGestureSourceTouchscreen);
- endScrollEvent.setScrollGestureData(0, 0, ScrollByPrecisePixel, 0, 0,
- ScrollInertialPhaseMomentum, false,
- -1 /* null plugin id */);
-
+ WebGestureEvent endScrollEvent = createGestureScrollEventFromFling(
+ WebInputEvent::GestureScrollEnd, lastFlingSourceDevice);
mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(
endScrollEvent);
}
@@ -3808,14 +3799,14 @@ WebHitTestResult WebViewImpl::hitTestResultForTap(
tapEvent.data.tap.width = tapArea.width;
tapEvent.data.tap.height = tapArea.height;
- PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(),
- tapEvent);
+ WebGestureEvent scaledEvent =
+ TransformWebGestureEvent(mainFrameImpl()->frameView(), tapEvent);
HitTestResult result =
m_page->deprecatedLocalMainFrame()
->eventHandler()
.hitTestResultForGestureEvent(
- platformEvent, HitTestRequest::ReadOnly | HitTestRequest::Active)
+ scaledEvent, HitTestRequest::ReadOnly | HitTestRequest::Active)
.hitTestResult();
result.setToShadowHostIfInUserAgentShadowRoot();
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.cpp ('k') | third_party/WebKit/Source/web/tests/VisualViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698