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

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

Issue 10628020: webkit/ppapi: Notify the container when a plugin is accepting touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Created 8 years, 6 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
« 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 3b6f26301caedf8aa8197b04511d6ebe0a29ce75..97930b50f17e3174432ed8246b8b855ff04c1cf0 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -497,6 +497,8 @@ bool PluginInstance::Initialize(WebPluginContainer* container,
plugin_url_ = plugin_url;
full_frame_ = full_frame;
+ container_->setIsAcceptingTouchEvents(IsAcceptingTouchEvents());
+
argn_ = arg_names;
argv_ = arg_values;
scoped_array<const char*> argn_array(StringVectorToArgArray(argn_));
@@ -1053,6 +1055,11 @@ bool PluginInstance::PluginHasFocus() const {
return has_webkit_focus_ && has_content_area_focus_;
}
+bool PluginInstance::IsAcceptingTouchEvents() const {
+ return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH) ||
+ (input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH);
+}
+
void PluginInstance::ScheduleAsyncDidChangeView(
const ::ppapi::ViewData& previous_view) {
if (view_change_weak_ptr_factory_.HasWeakPtrs())
@@ -1876,6 +1883,8 @@ 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());
return ValidateRequestInputEvents(false, event_classes);
}
@@ -1883,6 +1892,8 @@ 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());
return ValidateRequestInputEvents(true, event_classes);
}
@@ -1890,6 +1901,8 @@ 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());
}
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