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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2844823002: Support Coalesced Touch in ppapi (Closed)
Patch Set: Support Coalesced Touch in ppapi Created 3 years, 8 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: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 592133d4f5756491bb5a4f73d0e54de432c56972..fa9fbdc616bbe0aed066b269014a266b02a28e4f 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -97,6 +97,7 @@
#include "printing/features/features.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/URLConversion.h"
+#include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h"
#include "third_party/WebKit/public/platform/WebCursorInfo.h"
#include "third_party/WebKit/public/platform/WebFloatRect.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
@@ -1115,6 +1116,23 @@ gfx::Rect PepperPluginInstanceImpl::GetCaretBounds() const {
return caret;
}
+bool PepperPluginInstanceImpl::HandleCoalescedInputEvent(
+ const blink::WebCoalescedInputEvent& event,
+ WebCursorInfo* cursor_info) {
+ bool result = HandleInputEvent(event.Event(), cursor_info);
Navid Zolghadr 2017/05/02 19:17:40 One thing here. Note that the event itself is the
jkwang 2017/05/02 22:27:04 No, it's not a problem here. movement_x and moveme
Navid Zolghadr 2017/05/02 23:57:56 I still see this as not something that is desired.
jkwang 2017/05/03 00:36:00 Note that the loop below is indexed from 1 instead
Navid Zolghadr 2017/05/03 02:30:02 Sorry. I didn't notice that 0. That also seems inc
jkwang 2017/05/03 18:45:38 Done.
+
+ if (blink::WebInputEvent::IsTouchEventType(event.Event().GetType()) &&
+ ((filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_COALESCED_TOUCH) ||
+ (input_event_mask_ & PP_INPUTEVENT_CLASS_COALESCED_TOUCH))) {
+ // Handle all the Touch Events one by one. The event at index 0 is
+ // event.Event().
+ for (size_t i = 1; i < event.CoalescedEventSize(); ++i) {
+ HandleInputEvent(event.CoalescedEvent(i), cursor_info);
+ }
+ }
+ return result;
+}
+
bool PepperPluginInstanceImpl::HandleInputEvent(
const blink::WebInputEvent& event,
WebCursorInfo* cursor_info) {
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/pepper_webplugin_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698