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

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 225823007: Migrate wheel events to EventHandlerRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 7 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
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index e321c337713b91e0a6dec4724b374546a099a56d..b85d66f48929e44b335adc731a96698d63a84935 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -33,7 +33,6 @@
#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/ScriptController.h"
#include "core/dom/DocumentType.h"
-#include "core/dom/WheelController.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/editing/InputMethodController.h"
@@ -43,6 +42,7 @@
#include "core/events/Event.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/frame/DOMWindow.h"
+#include "core/frame/EventHandlerRegistry.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
@@ -507,13 +507,16 @@ void LocalFrame::deviceOrPageScaleFactorChanged()
void LocalFrame::notifyChromeClientWheelEventHandlerCountChanged() const
{
+ // TODO(skyostil): No-one is using this information, so remove this code.
// Ensure that this method is being called on the main frame of the page.
ASSERT(isMainFrame());
- unsigned count = 0;
- for (const LocalFrame* frame = this; frame; frame = frame->tree().traverseNext()) {
- if (frame->document())
- count += WheelController::from(*frame->document())->wheelEventHandlerCount();
+ EventHandlerRegistry& registry = m_host->eventHandlerRegistry();
+ unsigned count = registry.externalEventHandlerCount(EventHandlerRegistry::WheelEvent);
+ const EventTargetSet* targets = registry.eventHandlerTargets(EventHandlerRegistry::WheelEvent);
+ if (targets) {
ojan 2014/06/02 21:23:04 There's no official style rule, but we typically d
Sami 2014/06/03 15:57:45 Ah yes, that's a good idea. Done.
+ for (EventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter)
+ count += iter->value;
}
m_host->chrome().client().numWheelEventHandlersChanged(count);

Powered by Google App Engine
This is Rietveld 408576698