| 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 |
| 11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
| 12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
| 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of | 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
| 14 * its contributors may be used to endorse or promote products derived | 14 * its contributors may be used to endorse or promote products derived |
| 15 * from this software without specific prior written permission. | 15 * from this software without specific prior written permission. |
| 16 * | 16 * |
| 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef InspectorOverlayImpl_h | 29 #ifndef InspectorOverlay_h |
| 30 #define InspectorOverlayImpl_h | 30 #define InspectorOverlay_h |
| 31 | 31 |
| 32 #include "core/InspectorTypeBuilder.h" | 32 #include "core/InspectorTypeBuilder.h" |
| 33 #include "core/inspector/InspectorDOMAgent.h" | 33 #include "core/inspector/InspectorDOMAgent.h" |
| 34 #include "core/inspector/InspectorOverlayHost.h" | 34 #include "core/inspector/InspectorOverlayHost.h" |
| 35 #include "core/inspector/InspectorPageAgent.h" | 35 #include "core/inspector/InspectorPageAgent.h" |
| 36 #include "core/inspector/InspectorProfilerAgent.h" | 36 #include "core/inspector/InspectorProfilerAgent.h" |
| 37 #include "platform/Timer.h" | 37 #include "platform/Timer.h" |
| 38 #include "platform/geometry/FloatQuad.h" | 38 #include "platform/geometry/FloatQuad.h" |
| 39 #include "platform/geometry/LayoutRect.h" | 39 #include "platform/geometry/LayoutRect.h" |
| 40 #include "platform/graphics/Color.h" | 40 #include "platform/graphics/Color.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 54 class GraphicsLayer; | 54 class GraphicsLayer; |
| 55 class InspectorCSSAgent; | 55 class InspectorCSSAgent; |
| 56 class InspectorDebuggerAgent; | 56 class InspectorDebuggerAgent; |
| 57 class JSONValue; | 57 class JSONValue; |
| 58 class LayoutEditor; | 58 class LayoutEditor; |
| 59 class Node; | 59 class Node; |
| 60 class Page; | 60 class Page; |
| 61 class PageOverlay; | 61 class PageOverlay; |
| 62 class WebViewImpl; | 62 class WebViewImpl; |
| 63 | 63 |
| 64 class InspectorOverlayImpl final | 64 class InspectorOverlay final |
| 65 : public NoBaseWillBeGarbageCollectedFinalized<InspectorOverlayImpl> | 65 : public NoBaseWillBeGarbageCollectedFinalized<InspectorOverlay> |
| 66 , public InspectorDOMAgent::Client | 66 , public InspectorDOMAgent::Client |
| 67 , public InspectorPageAgent::Client | 67 , public InspectorPageAgent::Client |
| 68 , public InspectorProfilerAgent::Client | 68 , public InspectorProfilerAgent::Client |
| 69 , public InspectorOverlayHost::Listener { | 69 , public InspectorOverlayHost::Listener { |
| 70 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorOverlayImpl); | 70 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorOverlay); |
| 71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayImpl); | 71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlay); |
| 72 public: | 72 public: |
| 73 static PassOwnPtrWillBeRawPtr<InspectorOverlayImpl> create(WebViewImpl* webV
iewImpl) | 73 static PassOwnPtrWillBeRawPtr<InspectorOverlay> create(WebViewImpl* webViewI
mpl) |
| 74 { | 74 { |
| 75 return adoptPtrWillBeNoop(new InspectorOverlayImpl(webViewImpl)); | 75 return adoptPtrWillBeNoop(new InspectorOverlay(webViewImpl)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 ~InspectorOverlayImpl() override; | 78 ~InspectorOverlay() override; |
| 79 DECLARE_TRACE(); | 79 DECLARE_TRACE(); |
| 80 | 80 |
| 81 void init(InspectorCSSAgent*, InspectorDebuggerAgent*, InspectorDOMAgent*); | 81 void init(InspectorCSSAgent*, InspectorDebuggerAgent*, InspectorDOMAgent*); |
| 82 | 82 |
| 83 void clear(); | 83 void clear(); |
| 84 bool handleInputEvent(const WebInputEvent&); | 84 bool handleInputEvent(const WebInputEvent&); |
| 85 void layout(); | 85 void layout(); |
| 86 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; | 86 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 explicit InspectorOverlayImpl(WebViewImpl*); | 89 explicit InspectorOverlay(WebViewImpl*); |
| 90 class InspectorOverlayChromeClient; | 90 class InspectorOverlayChromeClient; |
| 91 class InspectorPageOverlayDelegate; | 91 class InspectorPageOverlayDelegate; |
| 92 | 92 |
| 93 // InspectorOverlayHost::Listener implementation. | 93 // InspectorOverlayHost::Listener implementation. |
| 94 void overlayResumed() override; | 94 void overlayResumed() override; |
| 95 void overlaySteppedOver() override; | 95 void overlaySteppedOver() override; |
| 96 void overlayStartedPropertyChange(const String&) override; | 96 void overlayStartedPropertyChange(const String&) override; |
| 97 void overlayPropertyChanged(float) override; | 97 void overlayPropertyChanged(float) override; |
| 98 void overlayEndedPropertyChange() override; | 98 void overlayEndedPropertyChange() override; |
| 99 void overlayClearSelection(bool) override; | 99 void overlayClearSelection(bool) override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 121 void drawNodeHighlight(); | 121 void drawNodeHighlight(); |
| 122 void drawQuadHighlight(); | 122 void drawQuadHighlight(); |
| 123 void drawPausedInDebuggerMessage(); | 123 void drawPausedInDebuggerMessage(); |
| 124 void drawViewSize(); | 124 void drawViewSize(); |
| 125 | 125 |
| 126 Page* overlayPage(); | 126 Page* overlayPage(); |
| 127 LocalFrame* overlayMainFrame(); | 127 LocalFrame* overlayMainFrame(); |
| 128 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset
); | 128 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset
); |
| 129 void evaluateInOverlay(const String& method, const String& argument); | 129 void evaluateInOverlay(const String& method, const String& argument); |
| 130 void evaluateInOverlay(const String& method, PassRefPtr<JSONValue> argument)
; | 130 void evaluateInOverlay(const String& method, PassRefPtr<JSONValue> argument)
; |
| 131 void onTimer(Timer<InspectorOverlayImpl>*); | 131 void onTimer(Timer<InspectorOverlay>*); |
| 132 void rebuildOverlayPage(); | 132 void rebuildOverlayPage(); |
| 133 void invalidate(); | 133 void invalidate(); |
| 134 void scheduleUpdate(); | 134 void scheduleUpdate(); |
| 135 | 135 |
| 136 bool handleMousePress(); | 136 bool handleMousePress(); |
| 137 bool handleGestureEvent(const PlatformGestureEvent&); | 137 bool handleGestureEvent(const PlatformGestureEvent&); |
| 138 bool handleTouchEvent(const PlatformTouchEvent&); | 138 bool handleTouchEvent(const PlatformTouchEvent&); |
| 139 bool handleMouseMove(const PlatformMouseEvent&); | 139 bool handleMouseMove(const PlatformMouseEvent&); |
| 140 bool shouldSearchForNode(); | 140 bool shouldSearchForNode(); |
| 141 void inspect(Node*); | 141 void inspect(Node*); |
| 142 | 142 |
| 143 WebViewImpl* m_webViewImpl; | 143 WebViewImpl* m_webViewImpl; |
| 144 String m_pausedInDebuggerMessage; | 144 String m_pausedInDebuggerMessage; |
| 145 RefPtrWillBeMember<Node> m_highlightNode; | 145 RefPtrWillBeMember<Node> m_highlightNode; |
| 146 RefPtrWillBeMember<Node> m_eventTargetNode; | 146 RefPtrWillBeMember<Node> m_eventTargetNode; |
| 147 InspectorHighlightConfig m_nodeHighlightConfig; | 147 InspectorHighlightConfig m_nodeHighlightConfig; |
| 148 OwnPtr<FloatQuad> m_highlightQuad; | 148 OwnPtr<FloatQuad> m_highlightQuad; |
| 149 OwnPtrWillBeMember<Page> m_overlayPage; | 149 OwnPtrWillBeMember<Page> m_overlayPage; |
| 150 OwnPtrWillBeMember<InspectorOverlayChromeClient> m_overlayChromeClient; | 150 OwnPtrWillBeMember<InspectorOverlayChromeClient> m_overlayChromeClient; |
| 151 RefPtrWillBeMember<InspectorOverlayHost> m_overlayHost; | 151 RefPtrWillBeMember<InspectorOverlayHost> m_overlayHost; |
| 152 InspectorHighlightConfig m_quadHighlightConfig; | 152 InspectorHighlightConfig m_quadHighlightConfig; |
| 153 bool m_drawViewSize; | 153 bool m_drawViewSize; |
| 154 bool m_drawViewSizeWithGrid; | 154 bool m_drawViewSizeWithGrid; |
| 155 bool m_resizeTimerActive; | 155 bool m_resizeTimerActive; |
| 156 bool m_omitTooltip; | 156 bool m_omitTooltip; |
| 157 Timer<InspectorOverlayImpl> m_timer; | 157 Timer<InspectorOverlay> m_timer; |
| 158 int m_suspendCount; | 158 int m_suspendCount; |
| 159 bool m_inLayout; | 159 bool m_inLayout; |
| 160 bool m_needsUpdate; | 160 bool m_needsUpdate; |
| 161 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; | 161 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; |
| 162 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; | 162 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; |
| 163 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; | 163 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; |
| 164 OwnPtrWillBeMember<LayoutEditor> m_layoutEditor; | 164 OwnPtrWillBeMember<LayoutEditor> m_layoutEditor; |
| 165 OwnPtr<PageOverlay> m_pageOverlay; | 165 OwnPtr<PageOverlay> m_pageOverlay; |
| 166 RefPtrWillBeMember<Node> m_hoveredNodeForInspectMode; | 166 RefPtrWillBeMember<Node> m_hoveredNodeForInspectMode; |
| 167 InspectorDOMAgent::SearchMode m_inspectMode; | 167 InspectorDOMAgent::SearchMode m_inspectMode; |
| 168 OwnPtr<InspectorHighlightConfig> m_inspectModeHighlightConfig; | 168 OwnPtr<InspectorHighlightConfig> m_inspectModeHighlightConfig; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 } // namespace blink | 171 } // namespace blink |
| 172 | 172 |
| 173 | 173 |
| 174 #endif // InspectorOverlayImpl_h | 174 #endif // InspectorOverlay_h |
| OLD | NEW |