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

Unified Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 1828203003: Flash players weren't receiving mouse wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
index 08a0799da30733a8419d489946114b62866e9fd5..94dd414b43a53ec522dacc5a7761d08f80312801 100644
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -548,8 +548,8 @@ void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
if (m_touchEventRequestType == requestType || !m_element)
return;
- if (m_element->document().frameHost()) {
- EventHandlerRegistry& registry = m_element->document().frameHost()->eventHandlerRegistry();
+ if (FrameHost* frameHost = m_element->document().frameHost()) {
+ EventHandlerRegistry& registry = frameHost->eventHandlerRegistry();
if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == TouchEventRequestTypeNone)
registry.didAddEventHandler(*m_element, EventHandlerRegistry::TouchEventBlocking);
else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType != TouchEventRequestTypeNone)
@@ -562,6 +562,14 @@ void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents)
{
if (m_wantsWheelEvents == wantsWheelEvents)
return;
+ if (FrameHost* frameHost = m_element->document().frameHost()) {
+ EventHandlerRegistry& registry = frameHost->eventHandlerRegistry();
+ if (wantsWheelEvents)
+ registry.didAddEventHandler(*m_element, EventHandlerRegistry::WheelEventBlocking);
+ else
+ registry.didRemoveEventHandler(*m_element, EventHandlerRegistry::WheelEventBlocking);
+ }
+
m_wantsWheelEvents = wantsWheelEvents;
if (Page* page = m_element->document().page()) {
if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
@@ -720,6 +728,10 @@ void WebPluginContainerImpl::dispose()
m_isDisposed = true;
requestTouchEventType(TouchEventRequestTypeNone);
+ if (m_element && m_wantsWheelEvents) {
+ if (FrameHost* frameHost = m_element->document().frameHost())
+ frameHost->eventHandlerRegistry().didRemoveEventHandler(*m_element, EventHandlerRegistry::WheelEventBlocking);
aelias_OOO_until_Jul13 2016/03/24 19:15:05 Can we call "setWantsWheelEvents(false);" to avoid
dtapuska 2016/03/24 21:14:29 I wanted to avoid the updateGeometry call inside t
aelias_OOO_until_Jul13 2016/03/25 00:05:40 Why did you want that, is there a reason to think
+ }
if (m_webPlugin) {
RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() == this);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698