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

Side by Side Diff: third_party/WebKit/Source/web/InspectorOverlay.h

Issue 2218603003: Timeline: show white overlay till page being reloaded paints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 4 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 DECLARE_TRACE(); 76 DECLARE_TRACE();
77 77
78 void init(InspectorCSSAgent*, V8InspectorSession*, InspectorDOMAgent*); 78 void init(InspectorCSSAgent*, V8InspectorSession*, InspectorDOMAgent*);
79 79
80 void clear(); 80 void clear();
81 void suspend(); 81 void suspend();
82 void resume(); 82 void resume();
83 bool handleInputEvent(const WebInputEvent&); 83 bool handleInputEvent(const WebInputEvent&);
84 void pageLayoutInvalidated(bool resized); 84 void pageLayoutInvalidated(bool resized);
85 void setShowViewportSizeOnResize(bool); 85 void setShowViewportSizeOnResize(bool);
86 void setReloadingBanner(const String&);
87 void maybeClearReloadingBanner();
86 void setPausedInDebuggerMessage(const String&); 88 void setPausedInDebuggerMessage(const String&);
87 89
88 // Does not yet include paint. 90 // Does not yet include paint.
89 void updateAllLifecyclePhases(); 91 void updateAllLifecyclePhases();
90 92
91 PageOverlay* pageOverlay() { return m_pageOverlay.get(); }; 93 PageOverlay* pageOverlay() { return m_pageOverlay.get(); };
92 String evaluateInOverlayForTest(const String&); 94 String evaluateInOverlayForTest(const String&);
93 95
94 private: 96 private:
97 enum class MessageType {
dgozman 2016/08/08 16:28:00 Can we have a single message?
98 Empty,
99 Reloading,
100 PausedInDebugger
101 };
95 explicit InspectorOverlay(WebViewImpl*); 102 explicit InspectorOverlay(WebViewImpl*);
96 class InspectorOverlayChromeClient; 103 class InspectorOverlayChromeClient;
97 class InspectorPageOverlayDelegate; 104 class InspectorPageOverlayDelegate;
98 105
99 // InspectorOverlayHost::Listener implementation. 106 // InspectorOverlayHost::Listener implementation.
100 void overlayResumed() override; 107 void overlayResumed() override;
101 void overlaySteppedOver() override; 108 void overlaySteppedOver() override;
102 void overlayStartedPropertyChange(const String&) override; 109 void overlayStartedPropertyChange(const String&) override;
103 void overlayPropertyChanged(float) override; 110 void overlayPropertyChanged(float) override;
104 void overlayEndedPropertyChange() override; 111 void overlayEndedPropertyChange() override;
105 void overlayClearSelection(bool) override; 112 void overlayClearSelection(bool) override;
106 void overlayNextSelector() override; 113 void overlayNextSelector() override;
107 void overlayPreviousSelector() override; 114 void overlayPreviousSelector() override;
108 115
109 // InspectorDOMAgent::Client implementation. 116 // InspectorDOMAgent::Client implementation.
110 void hideHighlight() override; 117 void hideHighlight() override;
111 void highlightNode(Node*, const InspectorHighlightConfig&, bool omitTooltip) override; 118 void highlightNode(Node*, const InspectorHighlightConfig&, bool omitTooltip) override;
112 void highlightQuad(std::unique_ptr<FloatQuad>, const InspectorHighlightConfi g&) override; 119 void highlightQuad(std::unique_ptr<FloatQuad>, const InspectorHighlightConfi g&) override;
113 void setInspectMode(InspectorDOMAgent::SearchMode, std::unique_ptr<Inspector HighlightConfig>) override; 120 void setInspectMode(InspectorDOMAgent::SearchMode, std::unique_ptr<Inspector HighlightConfig>) override;
114 void setInspectedNode(Node*) override; 121 void setInspectedNode(Node*) override;
115 122
116 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig& , bool omitTooltip); 123 void highlightNode(Node*, Node* eventTarget, const InspectorHighlightConfig& , bool omitTooltip);
117 bool isEmpty(); 124 bool isEmpty();
118 void drawNodeHighlight(); 125 void drawNodeHighlight();
119 void drawQuadHighlight(); 126 void drawQuadHighlight();
120 void drawPausedInDebuggerMessage(); 127 void drawMessages();
121 void drawViewSize(); 128 void drawViewSize();
122 129
123 float windowToViewportScale() const; 130 float windowToViewportScale() const;
124 131
125 Page* overlayPage(); 132 Page* overlayPage();
126 LocalFrame* overlayMainFrame(); 133 LocalFrame* overlayMainFrame();
127 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset ); 134 void reset(const IntSize& viewportSize, const IntPoint& documentScrollOffset );
128 void evaluateInOverlay(const String& method, const String& argument); 135 void evaluateInOverlay(const String& method, const String& argument);
129 void evaluateInOverlay(const String& method, std::unique_ptr<protocol::Value > argument); 136 void evaluateInOverlay(const String& method, std::unique_ptr<protocol::Value > argument);
130 void onTimer(TimerBase*); 137 void onTimer(TimerBase*);
131 void rebuildOverlayPage(); 138 void rebuildOverlayPage();
132 void invalidate(); 139 void invalidate();
133 void scheduleUpdate(); 140 void scheduleUpdate();
134 void clearInternal(); 141 void clearInternal();
135 142
136 bool handleMousePress(); 143 bool handleMousePress();
137 bool handleGestureEvent(const PlatformGestureEvent&); 144 bool handleGestureEvent(const PlatformGestureEvent&);
138 bool handleTouchEvent(const PlatformTouchEvent&); 145 bool handleTouchEvent(const PlatformTouchEvent&);
139 bool handleMouseMove(const PlatformMouseEvent&); 146 bool handleMouseMove(const PlatformMouseEvent&);
140 bool shouldSearchForNode(); 147 bool shouldSearchForNode();
141 void inspect(Node*); 148 void inspect(Node*);
142 void initializeLayoutEditorIfNeeded(Node*); 149 void initializeLayoutEditorIfNeeded(Node*);
143 150
144 WebViewImpl* m_webViewImpl; 151 WebViewImpl* m_webViewImpl;
145 String m_pausedInDebuggerMessage; 152 String m_message;
153 MessageType m_messageType;
146 Member<Node> m_highlightNode; 154 Member<Node> m_highlightNode;
147 Member<Node> m_eventTargetNode; 155 Member<Node> m_eventTargetNode;
148 InspectorHighlightConfig m_nodeHighlightConfig; 156 InspectorHighlightConfig m_nodeHighlightConfig;
149 std::unique_ptr<FloatQuad> m_highlightQuad; 157 std::unique_ptr<FloatQuad> m_highlightQuad;
150 Member<Page> m_overlayPage; 158 Member<Page> m_overlayPage;
151 Member<InspectorOverlayChromeClient> m_overlayChromeClient; 159 Member<InspectorOverlayChromeClient> m_overlayChromeClient;
152 Member<InspectorOverlayHost> m_overlayHost; 160 Member<InspectorOverlayHost> m_overlayHost;
153 InspectorHighlightConfig m_quadHighlightConfig; 161 InspectorHighlightConfig m_quadHighlightConfig;
154 bool m_drawViewSize; 162 bool m_drawViewSize;
155 bool m_resizeTimerActive; 163 bool m_resizeTimerActive;
156 bool m_omitTooltip; 164 bool m_omitTooltip;
157 Timer<InspectorOverlay> m_timer; 165 Timer<InspectorOverlay> m_timer;
158 bool m_suspended; 166 bool m_suspended;
159 bool m_inLayout; 167 bool m_inLayout;
160 bool m_needsUpdate; 168 bool m_needsUpdate;
161 V8InspectorSession* m_v8Session; 169 V8InspectorSession* m_v8Session;
162 Member<InspectorDOMAgent> m_domAgent; 170 Member<InspectorDOMAgent> m_domAgent;
163 Member<InspectorCSSAgent> m_cssAgent; 171 Member<InspectorCSSAgent> m_cssAgent;
164 Member<LayoutEditor> m_layoutEditor; 172 Member<LayoutEditor> m_layoutEditor;
165 std::unique_ptr<PageOverlay> m_pageOverlay; 173 std::unique_ptr<PageOverlay> m_pageOverlay;
166 Member<Node> m_hoveredNodeForInspectMode; 174 Member<Node> m_hoveredNodeForInspectMode;
167 InspectorDOMAgent::SearchMode m_inspectMode; 175 InspectorDOMAgent::SearchMode m_inspectMode;
168 std::unique_ptr<InspectorHighlightConfig> m_inspectModeHighlightConfig; 176 std::unique_ptr<InspectorHighlightConfig> m_inspectModeHighlightConfig;
169 }; 177 };
170 178
171 } // namespace blink 179 } // namespace blink
172 180
173 181
174 #endif // InspectorOverlay_h 182 #endif // InspectorOverlay_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698