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

Unified Diff: trunk/Source/core/frame/LocalDOMWindow.cpp

Issue 391483002: Revert 177812 "Migrate touch events to EventHandlerRegistry" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 | « trunk/Source/core/frame/EventHandlerRegistry.cpp ('k') | trunk/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/frame/LocalDOMWindow.cpp
===================================================================
--- trunk/Source/core/frame/LocalDOMWindow.cpp (revision 177995)
+++ trunk/Source/core/frame/LocalDOMWindow.cpp (working copy)
@@ -414,6 +414,11 @@
}
m_frame->selection().updateSecureKeyboardEntryIfActive();
+
+ if (m_frame->isMainFrame()) {
+ if (m_document->hasTouchEventHandlers())
+ m_frame->host()->chrome().client().needTouchEvents(true);
+ }
return m_document;
}
@@ -1536,7 +1541,9 @@
if (Document* document = this->document()) {
document->addListenerTypeIfNeeded(eventType);
- if (eventType == EventTypeNames::storage)
+ if (isTouchEventType(eventType))
+ document->didAddTouchEventHandler(document);
+ else if (eventType == EventTypeNames::storage)
didAddStorageEventListener(this);
}
@@ -1569,6 +1576,11 @@
if (m_frame && m_frame->host())
m_frame->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eventType);
+ if (Document* document = this->document()) {
+ if (isTouchEventType(eventType))
+ document->didRemoveTouchEventHandler(document);
+ }
+
lifecycleNotifier().notifyRemoveEventListener(this, eventType);
if (eventType == EventTypeNames::unload) {
@@ -1637,6 +1649,9 @@
if (mode == DoBroadcastListenerRemoval) {
if (m_frame && m_frame->host())
m_frame->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
+
+ if (Document* document = this->document())
+ document->didClearTouchEventHandlers(document);
}
removeAllUnloadEventListeners(this);
« no previous file with comments | « trunk/Source/core/frame/EventHandlerRegistry.cpp ('k') | trunk/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698