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 db418cce51b6df23abf3a3698c7259ff5d253aa8..9488d00d0249b5424980663469e0c10fbb83b1c2 100644 |
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc |
@@ -563,6 +563,7 @@ bool PluginInstance::Initialize(WebPluginContainer* container, |
full_frame_ = full_frame; |
container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); |
+ container_->setWantsWheelEvents(IsAcceptingWheelEvents()); |
SetGPUHistogram(delegate_->GetPreferences(), arg_names, arg_values); |
@@ -669,6 +670,13 @@ bool PluginInstance::SendCompositionEventWithUnderlineInformationToPlugin( |
return handled; |
} |
+void PluginInstance::RequestInputEventsHelper(uint32_t event_classes) { |
+ if (event_classes & PP_INPUTEVENT_CLASS_TOUCH) |
+ container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); |
+ if (event_classes & PP_INPUTEVENT_CLASS_WHEEL) |
+ container_->setWantsWheelEvents(IsAcceptingWheelEvents()); |
+} |
+ |
bool PluginInstance::HandleCompositionStart(const string16& text) { |
return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_START, |
text); |
@@ -1176,6 +1184,11 @@ bool PluginInstance::IsAcceptingTouchEvents() const { |
(input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH); |
} |
+bool PluginInstance::IsAcceptingWheelEvents() const { |
+ return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL) || |
+ (input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL); |
+} |
+ |
void PluginInstance::ScheduleAsyncDidChangeView() { |
if (view_change_weak_ptr_factory_.HasWeakPtrs()) |
return; // Already scheduled. |
@@ -2138,8 +2151,7 @@ int32_t PluginInstance::RequestInputEvents(PP_Instance instance, |
uint32_t event_classes) { |
input_event_mask_ |= event_classes; |
filtered_input_event_mask_ &= ~(event_classes); |
- if (event_classes & PP_INPUTEVENT_CLASS_TOUCH) |
- container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); |
+ RequestInputEventsHelper(event_classes); |
return ValidateRequestInputEvents(false, event_classes); |
} |
@@ -2147,8 +2159,7 @@ int32_t PluginInstance::RequestFilteringInputEvents(PP_Instance instance, |
uint32_t event_classes) { |
filtered_input_event_mask_ |= event_classes; |
input_event_mask_ &= ~(event_classes); |
- if (event_classes & PP_INPUTEVENT_CLASS_TOUCH) |
- container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); |
+ RequestInputEventsHelper(event_classes); |
return ValidateRequestInputEvents(true, event_classes); |
} |
@@ -2156,8 +2167,7 @@ void PluginInstance::ClearInputEventRequest(PP_Instance instance, |
uint32_t event_classes) { |
input_event_mask_ &= ~(event_classes); |
filtered_input_event_mask_ &= ~(event_classes); |
- if (event_classes & PP_INPUTEVENT_CLASS_TOUCH) |
- container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents()); |
+ RequestInputEventsHelper(event_classes); |
} |
void PluginInstance::ZoomChanged(PP_Instance instance, double factor) { |