| 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 13 matching lines...) Expand all Loading... |
| 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 InspectorOverlayImpl_h |
| 30 #define InspectorOverlayImpl_h | 30 #define InspectorOverlayImpl_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/InspectorHighlight.h" | |
| 35 #include "core/inspector/InspectorOverlayHost.h" | 34 #include "core/inspector/InspectorOverlayHost.h" |
| 36 #include "core/inspector/InspectorPageAgent.h" | 35 #include "core/inspector/InspectorPageAgent.h" |
| 37 #include "core/inspector/InspectorProfilerAgent.h" | 36 #include "core/inspector/InspectorProfilerAgent.h" |
| 38 #include "platform/Timer.h" | 37 #include "platform/Timer.h" |
| 39 #include "platform/geometry/FloatQuad.h" | 38 #include "platform/geometry/FloatQuad.h" |
| 40 #include "platform/geometry/LayoutRect.h" | 39 #include "platform/geometry/LayoutRect.h" |
| 41 #include "platform/graphics/Color.h" | 40 #include "platform/graphics/Color.h" |
| 42 #include "platform/heap/Handle.h" | 41 #include "platform/heap/Handle.h" |
| 43 #include "public/web/WebInputEvent.h" | 42 #include "public/web/WebInputEvent.h" |
| 44 #include "wtf/OwnPtr.h" | 43 #include "wtf/OwnPtr.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 72 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayImpl); | 71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayImpl); |
| 73 public: | 72 public: |
| 74 static PassOwnPtrWillBeRawPtr<InspectorOverlayImpl> create(WebViewImpl* webV
iewImpl) | 73 static PassOwnPtrWillBeRawPtr<InspectorOverlayImpl> create(WebViewImpl* webV
iewImpl) |
| 75 { | 74 { |
| 76 return adoptPtrWillBeNoop(new InspectorOverlayImpl(webViewImpl)); | 75 return adoptPtrWillBeNoop(new InspectorOverlayImpl(webViewImpl)); |
| 77 } | 76 } |
| 78 | 77 |
| 79 ~InspectorOverlayImpl() override; | 78 ~InspectorOverlayImpl() override; |
| 80 DECLARE_TRACE(); | 79 DECLARE_TRACE(); |
| 81 | 80 |
| 82 void init(InspectorCSSAgent*, InspectorDebuggerAgent*); | 81 void init(InspectorCSSAgent*, InspectorDebuggerAgent*, InspectorDOMAgent*); |
| 83 | 82 |
| 84 void update(); | 83 void update(); |
| 85 void clear(); | 84 void clear(); |
| 86 bool handleInputEvent(const WebInputEvent&); | 85 bool handleInputEvent(const WebInputEvent&); |
| 87 void layout(); | 86 void layout(); |
| 88 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; | 87 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; |
| 89 | 88 |
| 90 private: | 89 private: |
| 91 explicit InspectorOverlayImpl(WebViewImpl*); | 90 explicit InspectorOverlayImpl(WebViewImpl*); |
| 92 class InspectorOverlayChromeClient; | 91 class InspectorOverlayChromeClient; |
| 93 class InspectorPageOverlayDelegate; | 92 class InspectorPageOverlayDelegate; |
| 94 | 93 |
| 95 // InspectorOverlayHost::Listener implementation. | 94 // InspectorOverlayHost::Listener implementation. |
| 96 void overlayResumed() override; | 95 void overlayResumed() override; |
| 97 void overlaySteppedOver() override; | 96 void overlaySteppedOver() override; |
| 98 void overlayStartedPropertyChange(const String&) override; | 97 void overlayStartedPropertyChange(const String&) override; |
| 99 void overlayPropertyChanged(float) override; | 98 void overlayPropertyChanged(float) override; |
| 100 void overlayEndedPropertyChange() override; | 99 void overlayEndedPropertyChange() override; |
| 101 | 100 |
| 102 // InspectorProfilerAgent::Client implementation. | 101 // InspectorProfilerAgent::Client implementation. |
| 103 void profilingStarted() override; | 102 void profilingStarted() override; |
| 104 void profilingStopped() override; | 103 void profilingStopped() override; |
| 105 | 104 |
| 106 // InspectorPageAgent::Client implementation. | 105 // InspectorPageAgent::Client implementation. |
| 107 void pageLayoutInvalidated(bool resized) override; | 106 void pageLayoutInvalidated(bool resized) override; |
| 108 void setShowViewportSizeOnResize(bool show, bool showGrid) override; | 107 void setShowViewportSizeOnResize(bool show, bool showGrid) override; |
| 109 void setPausedInDebuggerMessage(const String*) override; | 108 void setPausedInDebuggerMessage(const String*) override; |
| 110 | 109 |
| 111 // InspectorDOMAgent::Client implementation. | 110 // InspectorDOMAgent::Client implementation. |
| 112 void setInspectModeEnabled(bool) override; | |
| 113 void hideHighlight() override; | 111 void hideHighlight() override; |
| 114 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig&
, bool omitTooltip) override; | 112 void highlightNode(Node*, const InspectorHighlightConfig&, bool omitTooltip)
override; |
| 115 void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) o
verride; | 113 void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) o
verride; |
| 114 void setInspectMode(InspectorDOMAgent::SearchMode, PassOwnPtr<InspectorHighl
ightConfig>) override; |
| 116 | 115 |
| 116 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig&
, bool omitTooltip); |
| 117 bool isEmpty(); | 117 bool isEmpty(); |
| 118 void drawNodeHighlight(); | 118 void drawNodeHighlight(); |
| 119 void drawQuadHighlight(); | 119 void drawQuadHighlight(); |
| 120 void drawPausedInDebuggerMessage(); | 120 void drawPausedInDebuggerMessage(); |
| 121 void drawViewSize(); | 121 void drawViewSize(); |
| 122 | 122 |
| 123 Page* overlayPage(); | 123 Page* overlayPage(); |
| 124 LocalFrame* overlayMainFrame(); | 124 LocalFrame* overlayMainFrame(); |
| 125 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset
); | 125 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset
); |
| 126 void evaluateInOverlay(const String& method, const String& argument); | 126 void evaluateInOverlay(const String& method, const String& argument); |
| 127 void evaluateInOverlay(const String& method, PassRefPtr<JSONValue> argument)
; | 127 void evaluateInOverlay(const String& method, PassRefPtr<JSONValue> argument)
; |
| 128 void onTimer(Timer<InspectorOverlayImpl>*); | 128 void onTimer(Timer<InspectorOverlayImpl>*); |
| 129 void rebuildOverlayPage(); | 129 void rebuildOverlayPage(); |
| 130 void invalidate(); | 130 void invalidate(); |
| 131 | 131 |
| 132 bool handleMousePress(); |
| 133 bool handleGestureEvent(const PlatformGestureEvent&); |
| 134 bool handleTouchEvent(const PlatformTouchEvent&); |
| 135 bool handleMouseMove(const PlatformMouseEvent&); |
| 136 |
| 132 WebViewImpl* m_webViewImpl; | 137 WebViewImpl* m_webViewImpl; |
| 133 String m_pausedInDebuggerMessage; | 138 String m_pausedInDebuggerMessage; |
| 134 bool m_inspectModeEnabled; | |
| 135 RefPtrWillBeMember<Node> m_highlightNode; | 139 RefPtrWillBeMember<Node> m_highlightNode; |
| 136 RefPtrWillBeMember<Node> m_eventTargetNode; | 140 RefPtrWillBeMember<Node> m_eventTargetNode; |
| 137 InspectorHighlightConfig m_nodeHighlightConfig; | 141 InspectorHighlightConfig m_nodeHighlightConfig; |
| 138 OwnPtr<FloatQuad> m_highlightQuad; | 142 OwnPtr<FloatQuad> m_highlightQuad; |
| 139 OwnPtrWillBeMember<Page> m_overlayPage; | 143 OwnPtrWillBeMember<Page> m_overlayPage; |
| 140 OwnPtrWillBeMember<InspectorOverlayChromeClient> m_overlayChromeClient; | 144 OwnPtrWillBeMember<InspectorOverlayChromeClient> m_overlayChromeClient; |
| 141 RefPtrWillBeMember<InspectorOverlayHost> m_overlayHost; | 145 RefPtrWillBeMember<InspectorOverlayHost> m_overlayHost; |
| 142 InspectorHighlightConfig m_quadHighlightConfig; | 146 InspectorHighlightConfig m_quadHighlightConfig; |
| 143 bool m_drawViewSize; | 147 bool m_drawViewSize; |
| 144 bool m_drawViewSizeWithGrid; | 148 bool m_drawViewSizeWithGrid; |
| 145 bool m_resizeTimerActive; | 149 bool m_resizeTimerActive; |
| 146 bool m_omitTooltip; | 150 bool m_omitTooltip; |
| 147 Timer<InspectorOverlayImpl> m_timer; | 151 Timer<InspectorOverlayImpl> m_timer; |
| 148 int m_suspendCount; | 152 int m_suspendCount; |
| 149 bool m_inLayout; | 153 bool m_inLayout; |
| 150 bool m_needsUpdate; | 154 bool m_needsUpdate; |
| 151 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; | 155 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; |
| 156 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; |
| 152 OwnPtrWillBeMember<LayoutEditor> m_layoutEditor; | 157 OwnPtrWillBeMember<LayoutEditor> m_layoutEditor; |
| 153 OwnPtr<PageOverlay> m_pageOverlay; | 158 OwnPtr<PageOverlay> m_pageOverlay; |
| 159 RefPtrWillBeMember<Node> m_hoveredNodeForInspectMode; |
| 160 InspectorDOMAgent::SearchMode m_inspectMode; |
| 161 OwnPtr<InspectorHighlightConfig> m_inspectModeHighlightConfig; |
| 154 }; | 162 }; |
| 155 | 163 |
| 156 } // namespace blink | 164 } // namespace blink |
| 157 | 165 |
| 158 | 166 |
| 159 #endif // InspectorOverlayImpl_h | 167 #endif // InspectorOverlayImpl_h |
| OLD | NEW |