| 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 29 matching lines...) Expand all Loading... |
| 40 #include "public/platform/WebInputEvent.h" | 40 #include "public/platform/WebInputEvent.h" |
| 41 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 43 #include <memory> | 43 #include <memory> |
| 44 #include <v8-inspector.h> | 44 #include <v8-inspector.h> |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 class Color; | 48 class Color; |
| 49 class LocalFrame; | 49 class LocalFrame; |
| 50 class InspectorCSSAgent; | |
| 51 class LayoutEditor; | |
| 52 class Node; | 50 class Node; |
| 53 class Page; | 51 class Page; |
| 54 class PageOverlay; | 52 class PageOverlay; |
| 55 class PlatformGestureEvent; | 53 class PlatformGestureEvent; |
| 56 class PlatformMouseEvent; | 54 class PlatformMouseEvent; |
| 57 class PlatformTouchEvent; | 55 class PlatformTouchEvent; |
| 58 class WebLocalFrameImpl; | 56 class WebLocalFrameImpl; |
| 59 | 57 |
| 60 namespace protocol { | 58 namespace protocol { |
| 61 class Value; | 59 class Value; |
| 62 } | 60 } |
| 63 | 61 |
| 64 class InspectorOverlay final | 62 class InspectorOverlay final |
| 65 : public GarbageCollectedFinalized<InspectorOverlay>, | 63 : public GarbageCollectedFinalized<InspectorOverlay>, |
| 66 public InspectorDOMAgent::Client, | 64 public InspectorDOMAgent::Client, |
| 67 public InspectorOverlayHost::Listener { | 65 public InspectorOverlayHost::Listener { |
| 68 USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlay); | 66 USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlay); |
| 69 | 67 |
| 70 public: | 68 public: |
| 71 explicit InspectorOverlay(WebLocalFrameImpl*); | 69 explicit InspectorOverlay(WebLocalFrameImpl*); |
| 72 ~InspectorOverlay() override; | 70 ~InspectorOverlay() override; |
| 73 DECLARE_TRACE(); | 71 DECLARE_TRACE(); |
| 74 | 72 |
| 75 void init(InspectorCSSAgent*, | 73 void init(v8_inspector::V8InspectorSession*, InspectorDOMAgent*); |
| 76 v8_inspector::V8InspectorSession*, | |
| 77 InspectorDOMAgent*); | |
| 78 | 74 |
| 79 void clear(); | 75 void clear(); |
| 80 void suspend(); | 76 void suspend(); |
| 81 void resume(); | 77 void resume(); |
| 82 bool handleInputEvent(const WebInputEvent&); | 78 bool handleInputEvent(const WebInputEvent&); |
| 83 void pageLayoutInvalidated(bool resized); | 79 void pageLayoutInvalidated(bool resized); |
| 84 void setShowViewportSizeOnResize(bool); | 80 void setShowViewportSizeOnResize(bool); |
| 85 void showReloadingBlanket(); | 81 void showReloadingBlanket(); |
| 86 void hideReloadingBlanket(); | 82 void hideReloadingBlanket(); |
| 87 void setPausedInDebuggerMessage(const String&); | 83 void setPausedInDebuggerMessage(const String&); |
| 88 | 84 |
| 89 // Does not yet include paint. | 85 // Does not yet include paint. |
| 90 void updateAllLifecyclePhases(); | 86 void updateAllLifecyclePhases(); |
| 91 | 87 |
| 92 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; | 88 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; |
| 93 String evaluateInOverlayForTest(const String&); | 89 String evaluateInOverlayForTest(const String&); |
| 94 | 90 |
| 95 private: | 91 private: |
| 96 class InspectorOverlayChromeClient; | 92 class InspectorOverlayChromeClient; |
| 97 class InspectorPageOverlayDelegate; | 93 class InspectorPageOverlayDelegate; |
| 98 | 94 |
| 99 // InspectorOverlayHost::Listener implementation. | 95 // InspectorOverlayHost::Listener implementation. |
| 100 void overlayResumed() override; | 96 void overlayResumed() override; |
| 101 void overlaySteppedOver() override; | 97 void overlaySteppedOver() override; |
| 102 void overlayStartedPropertyChange(const String&) override; | |
| 103 void overlayPropertyChanged(float) override; | |
| 104 void overlayEndedPropertyChange() override; | |
| 105 void overlayClearSelection(bool) override; | |
| 106 void overlayNextSelector() override; | |
| 107 void overlayPreviousSelector() override; | |
| 108 | 98 |
| 109 // InspectorDOMAgent::Client implementation. | 99 // InspectorDOMAgent::Client implementation. |
| 110 void hideHighlight() override; | 100 void hideHighlight() override; |
| 111 void highlightNode(Node*, | 101 void highlightNode(Node*, |
| 112 const InspectorHighlightConfig&, | 102 const InspectorHighlightConfig&, |
| 113 bool omitTooltip) override; | 103 bool omitTooltip) override; |
| 114 void highlightQuad(std::unique_ptr<FloatQuad>, | 104 void highlightQuad(std::unique_ptr<FloatQuad>, |
| 115 const InspectorHighlightConfig&) override; | 105 const InspectorHighlightConfig&) override; |
| 116 void setInspectMode(InspectorDOMAgent::SearchMode, | 106 void setInspectMode(InspectorDOMAgent::SearchMode, |
| 117 std::unique_ptr<InspectorHighlightConfig>) override; | 107 std::unique_ptr<InspectorHighlightConfig>) override; |
| 118 void setInspectedNode(Node*) override; | |
| 119 | 108 |
| 120 void highlightNode(Node*, | 109 void highlightNode(Node*, |
| 121 Node* eventTarget, | 110 Node* eventTarget, |
| 122 const InspectorHighlightConfig&, | 111 const InspectorHighlightConfig&, |
| 123 bool omitTooltip); | 112 bool omitTooltip); |
| 124 bool isEmpty(); | 113 bool isEmpty(); |
| 125 void drawNodeHighlight(); | 114 void drawNodeHighlight(); |
| 126 void drawQuadHighlight(); | 115 void drawQuadHighlight(); |
| 127 void drawPausedInDebuggerMessage(); | 116 void drawPausedInDebuggerMessage(); |
| 128 void drawViewSize(); | 117 void drawViewSize(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 140 void invalidate(); | 129 void invalidate(); |
| 141 void scheduleUpdate(); | 130 void scheduleUpdate(); |
| 142 void clearInternal(); | 131 void clearInternal(); |
| 143 | 132 |
| 144 bool handleMousePress(); | 133 bool handleMousePress(); |
| 145 bool handleGestureEvent(const PlatformGestureEvent&); | 134 bool handleGestureEvent(const PlatformGestureEvent&); |
| 146 bool handleTouchEvent(const PlatformTouchEvent&); | 135 bool handleTouchEvent(const PlatformTouchEvent&); |
| 147 bool handleMouseMove(const PlatformMouseEvent&); | 136 bool handleMouseMove(const PlatformMouseEvent&); |
| 148 bool shouldSearchForNode(); | 137 bool shouldSearchForNode(); |
| 149 void inspect(Node*); | 138 void inspect(Node*); |
| 150 void initializeLayoutEditorIfNeeded(Node*); | |
| 151 | 139 |
| 152 Member<WebLocalFrameImpl> m_frameImpl; | 140 Member<WebLocalFrameImpl> m_frameImpl; |
| 153 String m_pausedInDebuggerMessage; | 141 String m_pausedInDebuggerMessage; |
| 154 Member<Node> m_highlightNode; | 142 Member<Node> m_highlightNode; |
| 155 Member<Node> m_eventTargetNode; | 143 Member<Node> m_eventTargetNode; |
| 156 InspectorHighlightConfig m_nodeHighlightConfig; | 144 InspectorHighlightConfig m_nodeHighlightConfig; |
| 157 std::unique_ptr<FloatQuad> m_highlightQuad; | 145 std::unique_ptr<FloatQuad> m_highlightQuad; |
| 158 Member<Page> m_overlayPage; | 146 Member<Page> m_overlayPage; |
| 159 Member<InspectorOverlayChromeClient> m_overlayChromeClient; | 147 Member<InspectorOverlayChromeClient> m_overlayChromeClient; |
| 160 Member<InspectorOverlayHost> m_overlayHost; | 148 Member<InspectorOverlayHost> m_overlayHost; |
| 161 InspectorHighlightConfig m_quadHighlightConfig; | 149 InspectorHighlightConfig m_quadHighlightConfig; |
| 162 bool m_drawViewSize; | 150 bool m_drawViewSize; |
| 163 bool m_resizeTimerActive; | 151 bool m_resizeTimerActive; |
| 164 bool m_omitTooltip; | 152 bool m_omitTooltip; |
| 165 Timer<InspectorOverlay> m_timer; | 153 Timer<InspectorOverlay> m_timer; |
| 166 bool m_suspended; | 154 bool m_suspended; |
| 167 bool m_showReloadingBlanket; | 155 bool m_showReloadingBlanket; |
| 168 bool m_inLayout; | 156 bool m_inLayout; |
| 169 bool m_needsUpdate; | 157 bool m_needsUpdate; |
| 170 v8_inspector::V8InspectorSession* m_v8Session; | 158 v8_inspector::V8InspectorSession* m_v8Session; |
| 171 Member<InspectorDOMAgent> m_domAgent; | 159 Member<InspectorDOMAgent> m_domAgent; |
| 172 Member<InspectorCSSAgent> m_cssAgent; | |
| 173 Member<LayoutEditor> m_layoutEditor; | |
| 174 std::unique_ptr<PageOverlay> m_pageOverlay; | 160 std::unique_ptr<PageOverlay> m_pageOverlay; |
| 175 Member<Node> m_hoveredNodeForInspectMode; | 161 Member<Node> m_hoveredNodeForInspectMode; |
| 176 InspectorDOMAgent::SearchMode m_inspectMode; | 162 InspectorDOMAgent::SearchMode m_inspectMode; |
| 177 std::unique_ptr<InspectorHighlightConfig> m_inspectModeHighlightConfig; | 163 std::unique_ptr<InspectorHighlightConfig> m_inspectModeHighlightConfig; |
| 178 }; | 164 }; |
| 179 | 165 |
| 180 } // namespace blink | 166 } // namespace blink |
| 181 | 167 |
| 182 #endif // InspectorOverlay_h | 168 #endif // InspectorOverlay_h |
| OLD | NEW |