Chromium Code Reviews| 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 c80fe6bd5639e7f1ad68d5478054d3717d3e748e..9657823ce8b66f7cd3c08018e3d1cbd686d94c1c 100644 |
| --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc |
| +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc |
| @@ -1292,6 +1292,11 @@ void PepperPluginInstanceImpl::ViewChanged( |
| view_data_.scroll_offset = PP_MakePoint(scroll_offset.width(), |
| scroll_offset.height()); |
| + // The view size may have changed and we might need to update |
| + // our registration of event listeners. |
| + UpdateTouchEventRequest(); |
| + container_->setWantsWheelEvents(IsAcceptingWheelEvents()); |
|
bbudge
2016/12/02 18:38:01
Would you consider refactoring IsAcceptingWheelEve
dtapuska
2016/12/02 19:42:08
Done.
|
| + |
| if (desired_fullscreen_state_ || view_data_.is_fullscreen) { |
| bool is_fullscreen_element = container_->isFullscreenElement(); |
| if (!view_data_.is_fullscreen && desired_fullscreen_state_ && |
| @@ -1635,6 +1640,12 @@ void PepperPluginInstanceImpl::SendFocusChangeNotification() { |
| } |
| void PepperPluginInstanceImpl::UpdateTouchEventRequest() { |
| + // If the view has 0 area don't request touch events. |
| + if (view_data_.rect.size.width == 0 || view_data_.rect.size.height == 0) { |
|
bbudge
2016/12/02 18:38:01
Could you use unobscured_rect_.IsEmpty() here inst
dtapuska
2016/12/02 19:42:07
Although that may be optimal I'd worry that it wou
bbudge
2016/12/02 22:10:29
OK
|
| + container_->requestTouchEventType( |
| + blink::WebPluginContainer::TouchEventRequestTypeNone); |
| + return; |
| + } |
| bool raw_touch = (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH) || |
| (input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH); |
| container_->requestTouchEventType( |
| @@ -1644,6 +1655,10 @@ void PepperPluginInstanceImpl::UpdateTouchEventRequest() { |
| } |
| bool PepperPluginInstanceImpl::IsAcceptingWheelEvents() const { |
| + // If the view has 0 area don't request wheel events. |
| + if (view_data_.rect.size.width == 0 || view_data_.rect.size.height == 0) |
| + return false; |
| + |
| return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL) || |
| (input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL); |
| } |