| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * | 10 * |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #include "web/PageOverlay.h" | 30 #include "web/PageOverlay.h" |
| 31 | 31 |
| 32 #include "core/frame/FrameHost.h" | 32 #include "core/frame/FrameHost.h" |
| 33 #include "core/frame/Settings.h" | 33 #include "core/frame/Settings.h" |
| 34 #include "core/page/Page.h" | 34 #include "core/page/Page.h" |
| 35 #include "platform/graphics/GraphicsContext.h" | 35 #include "platform/graphics/GraphicsContext.h" |
| 36 #include "platform/graphics/GraphicsLayer.h" | 36 #include "platform/graphics/GraphicsLayer.h" |
| 37 #include "platform/graphics/GraphicsLayerClient.h" | 37 #include "platform/graphics/GraphicsLayerClient.h" |
| 38 #include "public/platform/WebLayer.h" | 38 #include "public/platform/WebLayer.h" |
| 39 #include "public/web/WebPageOverlay.h" | |
| 40 #include "public/web/WebViewClient.h" | 39 #include "public/web/WebViewClient.h" |
| 41 #include "web/WebDevToolsAgentImpl.h" | 40 #include "web/WebDevToolsAgentImpl.h" |
| 42 #include "web/WebGraphicsContextImpl.h" | 41 #include "web/WebGraphicsContextImpl.h" |
| 43 #include "web/WebViewImpl.h" | 42 #include "web/WebViewImpl.h" |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 PassOwnPtr<PageOverlay> PageOverlay::create(WebViewImpl* viewImpl, WebPageOverla
y* overlay) | 46 PassOwnPtr<PageOverlay> PageOverlay::create(WebViewImpl* viewImpl, PassOwnPtr<Pa
geOverlay::Delegate> overlay) |
| 48 { | 47 { |
| 49 return adoptPtr(new PageOverlay(viewImpl, overlay)); | 48 return adoptPtr(new PageOverlay(viewImpl, overlay)); |
| 50 } | 49 } |
| 51 | 50 |
| 52 PageOverlay::PageOverlay(WebViewImpl* viewImpl, WebPageOverlay* overlay) | 51 PageOverlay::PageOverlay(WebViewImpl* viewImpl, PassOwnPtr<PageOverlay::Delegate
> overlay) |
| 53 : m_viewImpl(viewImpl) | 52 : m_viewImpl(viewImpl) |
| 54 , m_overlay(overlay) | 53 , m_overlay(overlay) |
| 55 , m_zOrder(0) | |
| 56 { | 54 { |
| 57 } | 55 } |
| 58 | 56 |
| 59 void PageOverlay::clear() | 57 PageOverlay::~PageOverlay() |
| 60 { | 58 { |
| 61 invalidateWebFrame(); | 59 invalidateWebFrame(); |
| 62 | 60 |
| 63 if (m_layer) { | 61 if (m_layer) { |
| 64 m_layer->removeFromParent(); | 62 m_layer->removeFromParent(); |
| 65 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentI
mpl()) | 63 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentI
mpl()) |
| 66 devTools->didRemovePageOverlay(m_layer.get()); | 64 devTools->didRemovePageOverlay(m_layer.get()); |
| 67 m_layer = nullptr; | 65 m_layer = nullptr; |
| 68 } | 66 } |
| 69 } | 67 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 WebSize size = m_viewImpl->size(); | 124 WebSize size = m_viewImpl->size(); |
| 127 if (m_viewImpl->page()) | 125 if (m_viewImpl->page()) |
| 128 size = expandedIntSize(m_viewImpl->page()->frameHost().pinchViewport
().visibleSize()); | 126 size = expandedIntSize(m_viewImpl->page()->frameHost().pinchViewport
().visibleSize()); |
| 129 WebRect damagedRect(0, 0, size.width, size.height); | 127 WebRect damagedRect(0, 0, size.width, size.height); |
| 130 if (m_viewImpl->client()) | 128 if (m_viewImpl->client()) |
| 131 m_viewImpl->client()->didInvalidateRect(damagedRect); | 129 m_viewImpl->client()->didInvalidateRect(damagedRect); |
| 132 } | 130 } |
| 133 } | 131 } |
| 134 | 132 |
| 135 } // namespace blink | 133 } // namespace blink |
| OLD | NEW |