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

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

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 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/web/DevToolsEmulator.cpp
diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.cpp b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
index e06a4549b7bc1e1b466bfbf5685828c0bf399733..034223d39e3c44ff69d722c5af89ed579eb0d61b 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -502,15 +502,15 @@ bool DevToolsEmulator::handleInputEvent(const WebInputEvent& inputEvent) {
// FIXME: This workaround is required for touch emulation on Mac, where
// compositor-side pinch handling is not enabled. See http://crbug.com/138003.
- bool isPinch = inputEvent.type == WebInputEvent::GesturePinchBegin ||
- inputEvent.type == WebInputEvent::GesturePinchUpdate ||
- inputEvent.type == WebInputEvent::GesturePinchEnd;
+ bool isPinch = inputEvent.type() == WebInputEvent::GesturePinchBegin ||
+ inputEvent.type() == WebInputEvent::GesturePinchUpdate ||
+ inputEvent.type() == WebInputEvent::GesturePinchEnd;
if (isPinch && m_touchEventEmulationEnabled) {
FrameView* frameView = page->deprecatedLocalMainFrame()->view();
WebGestureEvent scaledEvent = TransformWebGestureEvent(
frameView, static_cast<const WebGestureEvent&>(inputEvent));
float pageScaleFactor = page->pageScaleFactor();
- if (scaledEvent.type == WebInputEvent::GesturePinchBegin) {
+ if (scaledEvent.type() == WebInputEvent::GesturePinchBegin) {
WebFloatPoint gesturePosition = scaledEvent.positionInRootFrame();
m_lastPinchAnchorCss = WTF::wrapUnique(new IntPoint(
roundedIntPoint(gesturePosition + frameView->getScrollOffset())));
@@ -518,7 +518,7 @@ bool DevToolsEmulator::handleInputEvent(const WebInputEvent& inputEvent) {
WTF::wrapUnique(new IntPoint(flooredIntPoint(gesturePosition)));
m_lastPinchAnchorDip->scale(pageScaleFactor, pageScaleFactor);
}
- if (scaledEvent.type == WebInputEvent::GesturePinchUpdate &&
+ if (scaledEvent.type() == WebInputEvent::GesturePinchUpdate &&
m_lastPinchAnchorCss) {
float newPageScaleFactor = pageScaleFactor * scaledEvent.pinchScale();
IntPoint anchorCss(*m_lastPinchAnchorDip.get());
@@ -527,7 +527,7 @@ bool DevToolsEmulator::handleInputEvent(const WebInputEvent& inputEvent) {
m_webViewImpl->mainFrame()->setScrollOffset(
toIntSize(*m_lastPinchAnchorCss.get() - toIntSize(anchorCss)));
}
- if (scaledEvent.type == WebInputEvent::GesturePinchEnd) {
+ if (scaledEvent.type() == WebInputEvent::GesturePinchEnd) {
m_lastPinchAnchorCss.reset();
m_lastPinchAnchorDip.reset();
}
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.cpp ('k') | third_party/WebKit/Source/web/ExternalPopupMenu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698