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

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

Issue 1463823003: Return a enumeration of the state of handling of InputEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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/PageWidgetDelegate.cpp
diff --git a/third_party/WebKit/Source/web/PageWidgetDelegate.cpp b/third_party/WebKit/Source/web/PageWidgetDelegate.cpp
index 6071842ca60d39eab45b9a713b35c08493d517d0..4337e611540713dae719d6f056db959e251c781b 100644
--- a/third_party/WebKit/Source/web/PageWidgetDelegate.cpp
+++ b/third_party/WebKit/Source/web/PageWidgetDelegate.cpp
@@ -114,39 +114,38 @@ void PageWidgetDelegate::paintIgnoringCompositing(Page& page, WebCanvas* canvas,
paintInternal(page, canvas, rect, root, GlobalPaintFlattenCompositingLayers);
}
-bool PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const WebInputEvent& event, LocalFrame* root)
+WebInputEventResult PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const WebInputEvent& event, LocalFrame* root)
{
switch (event.type) {
// FIXME: WebKit seems to always return false on mouse events processing
// methods. For now we'll assume it has processed them (as we are only
// interested in whether keyboard events are processed).
- // FIXME: Why do we return true when there is no root or the root is
- // detached?
+ // FIXME: Why do we return HandleSuppressed when there is no root or
+ // the root is detached?
case WebInputEvent::MouseMove:
if (!root || !root->view())
- return true;
+ return WebInputEventResult::HandledSuppressed;
handler.handleMouseMove(*root, static_cast<const WebMouseEvent&>(event));
- return true;
+ return WebInputEventResult::HandledSystem;
case WebInputEvent::MouseLeave:
if (!root || !root->view())
- return true;
+ return WebInputEventResult::HandledSuppressed;
handler.handleMouseLeave(*root, static_cast<const WebMouseEvent&>(event));
- return true;
+ return WebInputEventResult::HandledSystem;
case WebInputEvent::MouseDown:
if (!root || !root->view())
- return true;
+ return WebInputEventResult::HandledSuppressed;
handler.handleMouseDown(*root, static_cast<const WebMouseEvent&>(event));
- return true;
+ return WebInputEventResult::HandledSystem;
case WebInputEvent::MouseUp:
if (!root || !root->view())
- return true;
+ return WebInputEventResult::HandledSuppressed;
handler.handleMouseUp(*root, static_cast<const WebMouseEvent&>(event));
- return true;
-
+ return WebInputEventResult::HandledSystem;
kotenkov 2016/01/12 20:55:00 It seems to me that there are a lot of changes in
dtapuska 2016/01/12 21:06:48 I agree the return values should be used. I wasn't
case WebInputEvent::MouseWheel:
if (!root || !root->view())
- return false;
+ return WebInputEventResult::NotHandled;
return handler.handleMouseWheel(*root, static_cast<const WebMouseWheelEvent&>(event));
case WebInputEvent::RawKeyDown:
@@ -177,16 +176,16 @@ bool PageWidgetDelegate::handleInputEvent(PageWidgetEventHandler& handler, const
case WebInputEvent::TouchEnd:
case WebInputEvent::TouchCancel:
if (!root || !root->view())
- return false;
+ return WebInputEventResult::NotHandled;
return handler.handleTouchEvent(*root, static_cast<const WebTouchEvent&>(event));
case WebInputEvent::GesturePinchBegin:
case WebInputEvent::GesturePinchEnd:
case WebInputEvent::GesturePinchUpdate:
// Touchscreen pinch events are currently not handled in main thread. Once they are,
// these should be passed to |handleGestureEvent| similar to gesture scroll events.
- return false;
+ return WebInputEventResult::NotHandled;
default:
- return false;
+ return WebInputEventResult::NotHandled;
}
}
@@ -213,12 +212,12 @@ void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame, const WebMouse
mainFrame.eventHandler().handleMouseReleaseEvent(PlatformMouseEventBuilder(mainFrame.view(), event));
}
-bool PageWidgetEventHandler::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEvent& event)
+WebInputEventResult PageWidgetEventHandler::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEvent& event)
{
return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(mainFrame.view(), event));
}
-bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTouchEvent& event)
+WebInputEventResult PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTouchEvent& event)
{
return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(mainFrame.view(), event));
}

Powered by Google App Engine
This is Rietveld 408576698