*/
#include "config.h"
-#include "PageOverlay.h"
+#include "web/PageOverlay.h"
-#include "WebPageOverlay.h"
-#include "WebViewClient.h"
-#include "WebViewImpl.h"
-#include "core/page/Page.h"
#include "core/frame/Settings.h"
+#include "core/page/Page.h"
+#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/graphics/GraphicsLayerClient.h"
#include "public/platform/WebLayer.h"
-
-using namespace WebCore;
+#include "public/web/WebPageOverlay.h"
+#include "public/web/WebViewClient.h"
+#include "web/WebViewImpl.h"
namespace blink {
{
}
-class OverlayGraphicsLayerClientImpl : public WebCore::GraphicsLayerClient {
+class OverlayGraphicsLayerClientImpl : public GraphicsLayerClient {
public:
static PassOwnPtr<OverlayGraphicsLayerClientImpl> create(WebPageOverlay* overlay)
{
virtual ~OverlayGraphicsLayerClientImpl() { }
- virtual void notifyAnimationStarted(const GraphicsLayer*, double wallClockTime, double monotonicTime) OVERRIDE { }
+ virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTime) OVERRIDE { }
virtual void paintContents(const GraphicsLayer*, GraphicsContext& gc, GraphicsLayerPaintingPhase, const IntRect& inClip)
{
if (m_layer) {
m_layer->removeFromParent();
+ if (Page* page = m_viewImpl->page())
+ page->inspectorController().didRemovePageOverlay(m_layer.get());
m_layer = nullptr;
m_layerClient = nullptr;
}
m_layer = GraphicsLayer::create(m_viewImpl->graphicsLayerFactory(), m_layerClient.get());
m_layer->setDrawsContent(true);
- // Compositor hit-testing does not know how to deal with layers that may be
- // transparent to events (see http://crbug.com/269598). So require
- // scrolling and touches on this layer to go to the main thread.
+ if (Page* page = m_viewImpl->page())
+ page->inspectorController().willAddPageOverlay(m_layer.get());
+
+ // This is required for contents of overlay to stay in sync with the page while scrolling.
WebLayer* platformLayer = m_layer->platformLayer();
platformLayer->setShouldScrollOnMainThread(true);
- WebVector<WebRect> webRects(static_cast<size_t>(1));
- webRects[0] = WebRect(0, 0, INT_MAX, INT_MAX);
- platformLayer->setTouchEventHandlerRegion(webRects);
}
FloatSize size(m_viewImpl->size());