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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11418134: ppapi: Opt-in to receive synthetic mouse events for touch-events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 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
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 6cd8b03e5bac1424b033f3c169e49a02e935766e..b2e20c25733db15e2977d379c2546847e7d8b476 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -562,7 +562,7 @@ bool PluginInstance::Initialize(WebPluginContainer* container,
plugin_url_ = plugin_url;
full_frame_ = full_frame;
- container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents());
+ UpdateTouchEventRequest();
container_->setWantsWheelEvents(IsAcceptingWheelEvents());
SetGPUHistogram(delegate_->GetPreferences(), arg_names, arg_values);
@@ -672,7 +672,7 @@ bool PluginInstance::SendCompositionEventWithUnderlineInformationToPlugin(
void PluginInstance::RequestInputEventsHelper(uint32_t event_classes) {
if (event_classes & PP_INPUTEVENT_CLASS_TOUCH)
- container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents());
+ UpdateTouchEventRequest();
if (event_classes & PP_INPUTEVENT_CLASS_WHEEL)
container_->setWantsWheelEvents(IsAcceptingWheelEvents());
}
@@ -1173,9 +1173,12 @@ void PluginInstance::SendFocusChangeNotification() {
instance_interface_->DidChangeFocus(pp_instance(), PP_FromBool(has_focus));
}
-bool PluginInstance::IsAcceptingTouchEvents() const {
- return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH) ||
- (input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH);
+void PluginInstance::UpdateTouchEventRequest() {
+ bool raw_touch = (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH) ||
+ (input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH);
+ container_->requestTouchEventType(raw_touch ?
+ WebKit::WebPluginContainer::TouchEventRequestTypeRaw :
+ WebKit::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse);
}
bool PluginInstance::IsAcceptingWheelEvents() const {
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698