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

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: Add unit test 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 | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | 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 0eeec221338e93d172d5959373b8dc2fa74ebd48..a5d888312c6df672dba730629e08af417544457c 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,7 @@ void WebPluginContainerImpl::dispose()
m_isDisposed = true;
requestTouchEventType(TouchEventRequestTypeNone);
+ setWantsWheelEvents(false);
if (m_webPlugin) {
RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() == this);
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698