Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: Source/web/InspectorOverlayImpl.h

Issue 1322053002: Devtools: Move inspectMode logic from InspectorDomAgent to InspectorOverlayImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayImpl); 72 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorOverlayImpl);
73 public: 73 public:
74 static PassOwnPtrWillBeRawPtr<InspectorOverlayImpl> create(WebViewImpl* webV iewImpl) 74 static PassOwnPtrWillBeRawPtr<InspectorOverlayImpl> create(WebViewImpl* webV iewImpl)
75 { 75 {
76 return adoptPtrWillBeNoop(new InspectorOverlayImpl(webViewImpl)); 76 return adoptPtrWillBeNoop(new InspectorOverlayImpl(webViewImpl));
77 } 77 }
78 78
79 ~InspectorOverlayImpl() override; 79 ~InspectorOverlayImpl() override;
80 DECLARE_TRACE(); 80 DECLARE_TRACE();
81 81
82 void init(InspectorCSSAgent*, InspectorDebuggerAgent*); 82 void init(InspectorCSSAgent*, InspectorDebuggerAgent*, InspectorDOMAgent*);
83 83
84 void update(); 84 void update();
85 void clear(); 85 void clear();
86 bool handleInputEvent(const WebInputEvent&); 86 bool handleInputEvent(const WebInputEvent&);
87 void layout(); 87 void layout();
88 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; 88 PageOverlay* pageOverlay() { return m_pageOverlay.get(); };
89 89
90 private: 90 private:
91 explicit InspectorOverlayImpl(WebViewImpl*); 91 explicit InspectorOverlayImpl(WebViewImpl*);
92 class InspectorOverlayChromeClient; 92 class InspectorOverlayChromeClient;
93 class InspectorPageOverlayDelegate; 93 class InspectorPageOverlayDelegate;
94 94
95 // InspectorOverlayHost::Listener implementation. 95 // InspectorOverlayHost::Listener implementation.
96 void overlayResumed() override; 96 void overlayResumed() override;
97 void overlaySteppedOver() override; 97 void overlaySteppedOver() override;
98 void overlayStartedPropertyChange(const String&) override; 98 void overlayStartedPropertyChange(const String&) override;
99 void overlayPropertyChanged(float) override; 99 void overlayPropertyChanged(float) override;
100 void overlayEndedPropertyChange() override; 100 void overlayEndedPropertyChange() override;
101 101
102 // InspectorProfilerAgent::Client implementation. 102 // InspectorProfilerAgent::Client implementation.
103 void profilingStarted() override; 103 void profilingStarted() override;
104 void profilingStopped() override; 104 void profilingStopped() override;
105 105
106 // InspectorPageAgent::Client implementation. 106 // InspectorPageAgent::Client implementation.
107 void pageLayoutInvalidated(bool resized) override; 107 void pageLayoutInvalidated(bool resized) override;
108 void setShowViewportSizeOnResize(bool show, bool showGrid) override; 108 void setShowViewportSizeOnResize(bool show, bool showGrid) override;
109 void setPausedInDebuggerMessage(const String*) override; 109 void setPausedInDebuggerMessage(const String*) override;
110 110
111 // InspectorDOMAgent::Client implementation. 111 // InspectorDOMAgent::Client implementation.
112 void setInspectModeEnabled(bool) override;
113 void hideHighlight() override; 112 void hideHighlight() override;
114 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig& , bool omitTooltip) override; 113 void highlightNode(Node*, const InspectorHighlightConfig&, bool omitTooltip) override;
115 void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) o verride; 114 void highlightQuad(PassOwnPtr<FloatQuad>, const InspectorHighlightConfig&) o verride;
115 void setInspectMode(InspectorDOMAgent::SearchMode, PassOwnPtr<InspectorHighl ightConfig>) override;
116 116
117 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig& , bool omitTooltip);
117 bool isEmpty(); 118 bool isEmpty();
118 void drawNodeHighlight(); 119 void drawNodeHighlight();
119 void drawQuadHighlight(); 120 void drawQuadHighlight();
120 void drawPausedInDebuggerMessage(); 121 void drawPausedInDebuggerMessage();
121 void drawViewSize(); 122 void drawViewSize();
122 123
123 Page* overlayPage(); 124 Page* overlayPage();
124 LocalFrame* overlayMainFrame(); 125 LocalFrame* overlayMainFrame();
125 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset ); 126 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset );
126 void evaluateInOverlay(const String& method, const String& argument); 127 void evaluateInOverlay(const String& method, const String& argument);
127 void evaluateInOverlay(const String& method, PassRefPtr<JSONValue> argument) ; 128 void evaluateInOverlay(const String& method, PassRefPtr<JSONValue> argument) ;
128 void onTimer(Timer<InspectorOverlayImpl>*); 129 void onTimer(Timer<InspectorOverlayImpl>*);
129 void rebuildOverlayPage(); 130 void rebuildOverlayPage();
130 void invalidate(); 131 void invalidate();
131 132
133 bool handleMousePress();
134 bool handleGestureEvent(const PlatformGestureEvent&);
135 bool handleTouchEvent(const PlatformTouchEvent&);
136 bool handleMouseMove(const PlatformMouseEvent&);
137
132 WebViewImpl* m_webViewImpl; 138 WebViewImpl* m_webViewImpl;
133 String m_pausedInDebuggerMessage; 139 String m_pausedInDebuggerMessage;
134 bool m_inspectModeEnabled;
135 RefPtrWillBeMember<Node> m_highlightNode; 140 RefPtrWillBeMember<Node> m_highlightNode;
136 RefPtrWillBeMember<Node> m_eventTargetNode; 141 RefPtrWillBeMember<Node> m_eventTargetNode;
137 InspectorHighlightConfig m_nodeHighlightConfig; 142 InspectorHighlightConfig m_nodeHighlightConfig;
138 OwnPtr<FloatQuad> m_highlightQuad; 143 OwnPtr<FloatQuad> m_highlightQuad;
139 OwnPtrWillBeMember<Page> m_overlayPage; 144 OwnPtrWillBeMember<Page> m_overlayPage;
140 OwnPtrWillBeMember<InspectorOverlayChromeClient> m_overlayChromeClient; 145 OwnPtrWillBeMember<InspectorOverlayChromeClient> m_overlayChromeClient;
141 RefPtrWillBeMember<InspectorOverlayHost> m_overlayHost; 146 RefPtrWillBeMember<InspectorOverlayHost> m_overlayHost;
142 InspectorHighlightConfig m_quadHighlightConfig; 147 InspectorHighlightConfig m_quadHighlightConfig;
143 bool m_drawViewSize; 148 bool m_drawViewSize;
144 bool m_drawViewSizeWithGrid; 149 bool m_drawViewSizeWithGrid;
145 bool m_resizeTimerActive; 150 bool m_resizeTimerActive;
146 bool m_omitTooltip; 151 bool m_omitTooltip;
147 Timer<InspectorOverlayImpl> m_timer; 152 Timer<InspectorOverlayImpl> m_timer;
148 int m_suspendCount; 153 int m_suspendCount;
149 bool m_inLayout; 154 bool m_inLayout;
150 bool m_needsUpdate; 155 bool m_needsUpdate;
151 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent; 156 RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent;
157 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent;
152 OwnPtrWillBeMember<LayoutEditor> m_layoutEditor; 158 OwnPtrWillBeMember<LayoutEditor> m_layoutEditor;
153 OwnPtr<PageOverlay> m_pageOverlay; 159 OwnPtr<PageOverlay> m_pageOverlay;
160 RefPtrWillBeMember<Node> m_hoveredNodeForInspectMode;
161 InspectorDOMAgent::SearchMode m_inspectMode;
162 OwnPtr<InspectorHighlightConfig> m_inspectModeHighlightConfig;
154 }; 163 };
155 164
156 } // namespace blink 165 } // namespace blink
157 166
158 167
159 #endif // InspectorOverlayImpl_h 168 #endif // InspectorOverlayImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698