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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 225903009: Migrate touch events to EventHandlerRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix indendation problems (added by meld?) Created 6 years, 4 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 | « Source/core/testing/Internals.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 36af06ed8187dba0d486eddea219a97e5db5dea8..7ca1835cfe2d351c6c53eb91ec8fb6af34516327 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -43,6 +43,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"
@@ -517,10 +518,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;
}
@@ -693,8 +697,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
ScriptForbiddenScope::AllowSuperUnsafeScript thisShouldBeRemoved;
@@ -709,8 +713,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);
}
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698