ViewGestureGeometryCollector.h [plain text]
#ifndef ViewGestureGeometryCollector_h
#define ViewGestureGeometryCollector_h
#include "MessageReceiver.h"
#include <wtf/RunLoop.h>
namespace WebCore {
class FloatPoint;
class FloatRect;
class Node;
}
namespace WebKit {
class WebPage;
class ViewGestureGeometryCollector : private IPC::MessageReceiver {
WTF_MAKE_FAST_ALLOCATED;
public:
ViewGestureGeometryCollector(WebPage&);
~ViewGestureGeometryCollector();
void mainFrameDidLayout();
void computeZoomInformationForNode(WebCore::Node&, WebCore::FloatPoint& origin, WebCore::FloatRect& renderRect, bool& isReplaced, double& viewportMinimumScale, double& viewportMaximumScale);
private:
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
void collectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin);
#if PLATFORM(MAC)
void collectGeometryForMagnificationGesture();
#endif
#if !PLATFORM(IOS_FAMILY)
void setRenderTreeSizeNotificationThreshold(uint64_t);
void sendDidHitRenderTreeSizeThresholdIfNeeded();
#endif
void dispatchDidCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, bool fitEntireRect, double viewportMinimumScale, double viewportMaximumScale);
void computeMinimumAndMaximumViewportScales(double& viewportMinimumScale, double& viewportMaximumScale) const;
#if PLATFORM(IOS_FAMILY)
Optional<std::pair<double, double>> computeTextLegibilityScales(double& viewportMinimumScale, double& viewportMaximumScale);
#endif
WebPage& m_webPage;
#if !PLATFORM(IOS_FAMILY)
uint64_t m_renderTreeSizeNotificationThreshold;
#else
Optional<std::pair<double, double>> m_cachedTextLegibilityScales;
#endif
};
}
#endif // ViewGestureGeometryCollector