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

Unified Diff: components/plugins/renderer/webview_plugin.cc

Issue 2479123003: WIP Add getCoalescedEvents API using vector of WebInputEvents (Closed)
Patch Set: Creating CoalescedWebInputEvent Created 4 years, 1 month 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: components/plugins/renderer/webview_plugin.cc
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 8d45c4201aed4e7b9429fc053c946a038c98455f..23189d8df6d31e567ca0af4b19e8167bceac6b08 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -17,7 +17,7 @@
#include "content/public/renderer/render_view.h"
#include "gin/converter.h"
#include "skia/ext/platform_canvas.h"
-#include "third_party/WebKit/public/platform/WebInputEvent.h"
+#include "third_party/WebKit/public/platform/CoalescedWebInputEvent.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebDocument.h"
@@ -33,7 +33,7 @@ using blink::WebDragData;
using blink::WebDragOperationsMask;
using blink::WebFrameWidget;
using blink::WebImage;
-using blink::WebInputEvent;
+using blink::CoalescedWebInputEvent;
using blink::WebLocalFrame;
using blink::WebMouseEvent;
using blink::WebPlugin;
@@ -188,28 +188,29 @@ void WebViewPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) {
}
blink::WebInputEventResult WebViewPlugin::handleInputEvent(
- const WebInputEvent& event,
+ const CoalescedWebInputEvent& coalescedEvent,
WebCursorInfo& cursor) {
// For tap events, don't handle them. They will be converted to
// mouse events later and passed to here.
- if (event.type == WebInputEvent::GestureTap)
+ if (coalescedEvent.event().type == blink::WebInputEvent::GestureTap)
return blink::WebInputEventResult::NotHandled;
// For LongPress events we return false, since otherwise the context menu will
// be suppressed. https://crbug.com/482842
- if (event.type == WebInputEvent::GestureLongPress)
+ if (coalescedEvent.event().type == blink::WebInputEvent::GestureLongPress)
return blink::WebInputEventResult::NotHandled;
- if (event.type == WebInputEvent::ContextMenu) {
+ if (coalescedEvent.event().type == blink::WebInputEvent::ContextMenu) {
if (delegate_) {
const WebMouseEvent& mouse_event =
- reinterpret_cast<const WebMouseEvent&>(event);
+ reinterpret_cast<const WebMouseEvent&>(coalescedEvent.event());
delegate_->ShowContextMenu(mouse_event);
}
return blink::WebInputEventResult::HandledSuppressed;
}
current_cursor_ = cursor;
- blink::WebInputEventResult handled = web_view_->handleInputEvent(event);
+ blink::WebInputEventResult handled =
+ web_view_->handleInputEvent(coalescedEvent);
cursor = current_cursor_;
return handled;

Powered by Google App Engine
This is Rietveld 408576698