| 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" |
| 42 #include "web/WebPageOverlay.h" |
| 43 #include "web/WebViewImpl.h" | 43 #include "web/WebViewImpl.h" |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| 47 PassOwnPtr<PageOverlay> PageOverlay::create(WebViewImpl* viewImpl, WebPageOverla
y* overlay) | 47 PassOwnPtr<PageOverlay> PageOverlay::create(WebViewImpl* viewImpl, WebPageOverla
y* overlay) |
| 48 { | 48 { |
| 49 return adoptPtr(new PageOverlay(viewImpl, overlay)); | 49 return adoptPtr(new PageOverlay(viewImpl, overlay)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 PageOverlay::PageOverlay(WebViewImpl* viewImpl, WebPageOverlay* overlay) | 52 PageOverlay::PageOverlay(WebViewImpl* viewImpl, WebPageOverlay* overlay) |
| 53 : m_viewImpl(viewImpl) | 53 : m_viewImpl(viewImpl) |
| 54 , m_overlay(overlay) | 54 , m_overlay(overlay) |
| 55 , m_zOrder(0) | |
| 56 { | 55 { |
| 57 } | 56 } |
| 58 | 57 |
| 59 void PageOverlay::clear() | 58 void PageOverlay::clear() |
| 60 { | 59 { |
| 61 invalidateWebFrame(); | 60 invalidateWebFrame(); |
| 62 | 61 |
| 63 if (m_layer) { | 62 if (m_layer) { |
| 64 m_layer->removeFromParent(); | 63 m_layer->removeFromParent(); |
| 65 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentI
mpl()) | 64 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentI
mpl()) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 WebSize size = m_viewImpl->size(); | 125 WebSize size = m_viewImpl->size(); |
| 127 if (m_viewImpl->page()) | 126 if (m_viewImpl->page()) |
| 128 size = expandedIntSize(m_viewImpl->page()->frameHost().pinchViewport
().visibleSize()); | 127 size = expandedIntSize(m_viewImpl->page()->frameHost().pinchViewport
().visibleSize()); |
| 129 WebRect damagedRect(0, 0, size.width, size.height); | 128 WebRect damagedRect(0, 0, size.width, size.height); |
| 130 if (m_viewImpl->client()) | 129 if (m_viewImpl->client()) |
| 131 m_viewImpl->client()->didInvalidateRect(damagedRect); | 130 m_viewImpl->client()->didInvalidateRect(damagedRect); |
| 132 } | 131 } |
| 133 } | 132 } |
| 134 | 133 |
| 135 } // namespace blink | 134 } // namespace blink |
| OLD | NEW |