Index: Source/web/WebPluginContainerImpl.cpp |
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp |
index c98cc9e520b6e07b169054c95b26d59e08b77a75..2725c7c881bebc6fbb00a6d557084930536f9868 100644 |
--- a/Source/web/WebPluginContainerImpl.cpp |
+++ b/Source/web/WebPluginContainerImpl.cpp |
@@ -53,6 +53,7 @@ |
#include "core/events/MouseEvent.h" |
#include "core/events/TouchEvent.h" |
#include "core/events/WheelEvent.h" |
+#include "core/frame/EventHandlerRegistry.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/LocalFrame.h" |
#include "core/html/HTMLFormElement.h" |
@@ -510,10 +511,13 @@ void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request |
if (m_touchEventRequestType == requestType) |
return; |
- if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == TouchEventRequestTypeNone) |
- m_element->document().didAddTouchEventHandler(m_element); |
- else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType != TouchEventRequestTypeNone) |
- m_element->document().didRemoveTouchEventHandler(m_element); |
+ if (m_element->document().frameHost()) { |
+ EventHandlerRegistry* registry = &m_element->document().frameHost()->eventHandlerRegistry(); |
Rick Byers
2014/06/19 17:10:36
nit again: ref instead of pointer?
Sami
2014/06/27 17:58:51
Done.
|
+ if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == TouchEventRequestTypeNone) |
+ registry->didAddEventHandler(*m_element, EventHandlerRegistry::TouchEvent); |
+ else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType != TouchEventRequestTypeNone) |
+ registry->didRemoveEventHandler(*m_element, EventHandlerRegistry::TouchEvent); |
+ } |
m_touchEventRequestType = requestType; |
} |
@@ -663,8 +667,8 @@ WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme |
WebPluginContainerImpl::~WebPluginContainerImpl() |
{ |
- if (m_touchEventRequestType != TouchEventRequestTypeNone) |
- m_element->document().didRemoveTouchEventHandler(m_element); |
+ if (m_touchEventRequestType != TouchEventRequestTypeNone && m_element->document().frameHost()) |
+ m_element->document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*m_element, EventHandlerRegistry::TouchEvent); |
for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i) |
m_pluginLoadObservers[i]->clearPluginContainer(); |