RemoteScrollingCoordinatorProxy.h [plain text]
#ifndef RemoteScrollingCoordinatorProxy_h
#define RemoteScrollingCoordinatorProxy_h
#if ENABLE(ASYNC_SCROLLING)
#include "MessageReceiver.h"
#include "RemoteScrollingCoordinator.h"
#include "RemoteScrollingTree.h"
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class FloatPoint;
class PlatformWheelEvent;
}
namespace WebKit {
class RemoteLayerTreeHost;
class RemoteScrollingCoordinatorTransaction;
class RemoteScrollingTree;
class WebPageProxy;
class RemoteScrollingCoordinatorProxy {
WTF_MAKE_NONCOPYABLE(RemoteScrollingCoordinatorProxy);
public:
explicit RemoteScrollingCoordinatorProxy(WebPageProxy&);
virtual ~RemoteScrollingCoordinatorProxy();
void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, WebCore::SetOrSyncScrollingLayerPosition);
void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll);
bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&) const;
void viewportChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::FloatRect& fixedPositionRect, double scale);
bool handleWheelEvent(const WebCore::PlatformWheelEvent&);
WebCore::ScrollingNodeID rootScrollingNodeID() const;
const RemoteLayerTreeHost* layerTreeHost() const;
struct RequestedScrollInfo {
bool requestsScrollPositionUpdate { };
bool requestIsProgrammaticScroll { };
WebCore::FloatPoint requestedScrollPosition;
};
void updateScrollingTree(const RemoteScrollingCoordinatorTransaction&, RequestedScrollInfo&);
void setPropagatesMainFrameScrolls(bool propagatesMainFrameScrolls) { m_propagatesMainFrameScrolls = propagatesMainFrameScrolls; }
bool propagatesMainFrameScrolls() const { return m_propagatesMainFrameScrolls; }
bool hasFixedOrSticky() const { return m_scrollingTree->hasFixedOrSticky(); }
#if PLATFORM(IOS)
WebCore::FloatRect customFixedPositionRect() const;
void scrollingTreeNodeWillStartPanGesture();
void scrollingTreeNodeWillStartScroll();
void scrollingTreeNodeDidEndScroll();
#endif
private:
void connectStateNodeLayers(WebCore::ScrollingStateTree&, const RemoteLayerTreeHost&);
WebPageProxy& m_webPageProxy;
RefPtr<RemoteScrollingTree> m_scrollingTree;
RequestedScrollInfo* m_requestedScrollInfo;
bool m_propagatesMainFrameScrolls;
};
}
#endif // ENABLE(ASYNC_SCROLLING)
#endif // RemoteScrollingCoordinatorProxy_h