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

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

Issue 11312195: webkit/ppapi: Notify the container when a plugin is accepting wheel events just like r143871. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, address feedback 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 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) {
« 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