| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return hoveredNodeForPoint(frame, roundedIntPoint(points[0].pos()), ignorePo
interEventsNone); | 98 return hoveredNodeForPoint(frame, roundedIntPoint(points[0].pos()), ignorePo
interEventsNone); |
| 99 } | 99 } |
| 100 } // namespace | 100 } // namespace |
| 101 | 101 |
| 102 class InspectorOverlay::InspectorPageOverlayDelegate final : public PageOverlay:
:Delegate { | 102 class InspectorOverlay::InspectorPageOverlayDelegate final : public PageOverlay:
:Delegate { |
| 103 public: | 103 public: |
| 104 explicit InspectorPageOverlayDelegate(InspectorOverlay& overlay) | 104 explicit InspectorPageOverlayDelegate(InspectorOverlay& overlay) |
| 105 : m_overlay(&overlay) | 105 : m_overlay(&overlay) |
| 106 { } | 106 { } |
| 107 | 107 |
| 108 DEFINE_INLINE_VIRTUAL_TRACE() | |
| 109 { | |
| 110 visitor->trace(m_overlay); | |
| 111 PageOverlay::Delegate::trace(visitor); | |
| 112 } | |
| 113 | |
| 114 void paintPageOverlay(const PageOverlay&, GraphicsContext& graphicsContext,
const WebSize& webViewSize) const override | 108 void paintPageOverlay(const PageOverlay&, GraphicsContext& graphicsContext,
const WebSize& webViewSize) const override |
| 115 { | 109 { |
| 116 if (m_overlay->isEmpty()) | 110 if (m_overlay->isEmpty()) |
| 117 return; | 111 return; |
| 118 | 112 |
| 119 FrameView* view = m_overlay->overlayMainFrame()->view(); | 113 FrameView* view = m_overlay->overlayMainFrame()->view(); |
| 120 DCHECK(!view->needsLayout()); | 114 DCHECK(!view->needsLayout()); |
| 121 view->paint(graphicsContext, CullRect(IntRect(0, 0, view->width(), view-
>height()))); | 115 view->paint(graphicsContext, CullRect(IntRect(0, 0, view->width(), view-
>height()))); |
| 122 } | 116 } |
| 123 | 117 |
| 124 private: | 118 private: |
| 125 Member<InspectorOverlay> m_overlay; | 119 Persistent<InspectorOverlay> m_overlay; |
| 126 }; | 120 }; |
| 127 | 121 |
| 128 | 122 |
| 129 class InspectorOverlay::InspectorOverlayChromeClient final : public EmptyChromeC
lient { | 123 class InspectorOverlay::InspectorOverlayChromeClient final : public EmptyChromeC
lient { |
| 130 public: | 124 public: |
| 131 static InspectorOverlayChromeClient* create(ChromeClient& client, InspectorO
verlay& overlay) | 125 static InspectorOverlayChromeClient* create(ChromeClient& client, InspectorO
verlay& overlay) |
| 132 { | 126 { |
| 133 return new InspectorOverlayChromeClient(client, overlay); | 127 return new InspectorOverlayChromeClient(client, overlay); |
| 134 } | 128 } |
| 135 | 129 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 { | 207 { |
| 214 m_v8Session = v8Session; | 208 m_v8Session = v8Session; |
| 215 m_domAgent = domAgent; | 209 m_domAgent = domAgent; |
| 216 m_cssAgent = cssAgent; | 210 m_cssAgent = cssAgent; |
| 217 m_overlayHost->setListener(this); | 211 m_overlayHost->setListener(this); |
| 218 } | 212 } |
| 219 | 213 |
| 220 void InspectorOverlay::invalidate() | 214 void InspectorOverlay::invalidate() |
| 221 { | 215 { |
| 222 if (!m_pageOverlay) | 216 if (!m_pageOverlay) |
| 223 m_pageOverlay = PageOverlay::create(m_webViewImpl, new InspectorPageOver
layDelegate(*this)); | 217 m_pageOverlay = PageOverlay::create(m_webViewImpl, wrapUnique(new Inspec
torPageOverlayDelegate(*this))); |
| 224 | 218 |
| 225 m_pageOverlay->update(); | 219 m_pageOverlay->update(); |
| 226 } | 220 } |
| 227 | 221 |
| 228 void InspectorOverlay::updateAllLifecyclePhases() | 222 void InspectorOverlay::updateAllLifecyclePhases() |
| 229 { | 223 { |
| 230 if (isEmpty()) | 224 if (isEmpty()) |
| 231 return; | 225 return; |
| 232 | 226 |
| 233 AutoReset<bool> scoped(&m_inLayout, true); | 227 AutoReset<bool> scoped(&m_inLayout, true); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 | 788 |
| 795 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) | 789 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) |
| 796 { | 790 { |
| 797 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) | 791 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node->
isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg
ent) |
| 798 return; | 792 return; |
| 799 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); | 793 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen
t, &overlayMainFrame()->script()); |
| 800 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); | 794 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde
n(true); |
| 801 } | 795 } |
| 802 | 796 |
| 803 } // namespace blink | 797 } // namespace blink |
| OLD | NEW |