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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1639363002: Move have_wheel_event_handlers to WebLayerTreeView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 11 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: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 84744848cfe370946fd1b638d8113ee47e8be747..b18b108ff77057ed634fd81e50903ea0de4da478 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -92,6 +92,7 @@ ScrollingCoordinator::ScrollingCoordinator(Page* page)
, m_touchEventTargetRectsAreDirty(false)
, m_shouldScrollOnMainThreadDirty(false)
, m_wasFrameScrollable(false)
+ , m_webLayerTreeView(nullptr)
, m_lastMainThreadScrollingReasons(0)
{
}
@@ -684,13 +685,10 @@ void ScrollingCoordinator::updateHaveWheelEventHandlers()
{
ASSERT(isMainThread());
ASSERT(m_page);
- if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFrame()->view())
+ if (!m_webLayerTreeView)
return;
- if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->view()->layerForScrolling())) {
- bool haveHandlers = m_page->frameHost().eventHandlerRegistry().hasEventHandlers(EventHandlerRegistry::WheelEvent);
- scrollLayer->setHaveWheelEventHandlers(haveHandlers);
- }
+ m_webLayerTreeView->setHaveWheelEventHandlers(m_page->frameHost().eventHandlerRegistry().hasEventHandlers(EventHandlerRegistry::WheelEvent));
}
void ScrollingCoordinator::updateHaveScrollEventHandlers()
@@ -729,6 +727,7 @@ void ScrollingCoordinator::layerTreeViewInitialized(WebLayerTreeView& layerTreeV
m_programmaticScrollAnimatorTimeline = adoptPtr(Platform::current()->compositorSupport()->createAnimationTimeline());
layerTreeView.attachCompositorAnimationTimeline(m_programmaticScrollAnimatorTimeline.get());
}
+ m_webLayerTreeView = &layerTreeView;
aelias_OOO_until_Jul13 2016/01/27 23:55:46 I don't think we should make ScrollingCoordinator
dtapuska 2016/01/28 16:23:06 Done.
}
void ScrollingCoordinator::willCloseLayerTreeView(WebLayerTreeView& layerTreeView)
@@ -737,6 +736,7 @@ void ScrollingCoordinator::willCloseLayerTreeView(WebLayerTreeView& layerTreeVie
layerTreeView.detachCompositorAnimationTimeline(m_programmaticScrollAnimatorTimeline.get());
m_programmaticScrollAnimatorTimeline.clear();
}
+ m_webLayerTreeView = nullptr;
}
void ScrollingCoordinator::willBeDestroyed()

Powered by Google App Engine
This is Rietveld 408576698