| Index: Source/web/WebPluginContainerImpl.cpp
|
| diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
|
| index cbc08918f32bd608d3c35512ceac1d659ac0a7a0..06b0a0042bcff347ae7fab691578a9c815536b6f 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"
|
| @@ -513,10 +514,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();
|
| + 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;
|
| }
|
|
|
| @@ -679,8 +683,8 @@ WebPluginContainerImpl::~WebPluginContainerImpl()
|
| //
|
| m_element = 0;
|
| #else
|
| - 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);
|
| #endif
|
|
|
| for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i)
|
| @@ -693,8 +697,8 @@ WebPluginContainerImpl::~WebPluginContainerImpl()
|
| #if ENABLE(OILPAN)
|
| void WebPluginContainerImpl::detach()
|
| {
|
| - 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);
|
|
|
| setWebLayer(0);
|
| }
|
|
|