OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 #include "public/platform/WebSize.h" | 37 #include "public/platform/WebSize.h" |
38 #include "public/platform/WebThread.h" | 38 #include "public/platform/WebThread.h" |
39 #include "public/web/WebPageOverlay.h" | 39 #include "public/web/WebPageOverlay.h" |
40 #include "web/WebDevToolsAgentPrivate.h" | 40 #include "web/WebDevToolsAgentPrivate.h" |
41 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
42 #include "wtf/OwnPtr.h" | 42 #include "wtf/OwnPtr.h" |
43 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
| 46 |
46 class Document; | 47 class Document; |
47 class LocalFrame; | 48 class LocalFrame; |
48 class FrameView; | 49 class FrameView; |
49 class GraphicsContext; | 50 class GraphicsContext; |
50 class InspectorClient; | 51 class InspectorClient; |
51 class InspectorController; | 52 class InspectorController; |
52 class Node; | 53 class Node; |
53 class Page; | 54 class Page; |
54 class PlatformKeyboardEvent; | 55 class PlatformKeyboardEvent; |
55 } | |
56 | |
57 namespace blink { | |
58 | |
59 class WebDevToolsAgentClient; | 56 class WebDevToolsAgentClient; |
60 class WebFrame; | 57 class WebFrame; |
61 class WebLocalFrameImpl; | 58 class WebLocalFrameImpl; |
62 class WebString; | 59 class WebString; |
63 class WebURLRequest; | 60 class WebURLRequest; |
64 class WebURLResponse; | 61 class WebURLResponse; |
65 class WebViewImpl; | 62 class WebViewImpl; |
66 struct WebMemoryUsageInfo; | 63 struct WebMemoryUsageInfo; |
67 struct WebURLError; | 64 struct WebURLError; |
68 struct WebDevToolsMessageData; | 65 struct WebDevToolsMessageData; |
69 | 66 |
70 class WebDevToolsAgentImpl FINAL | 67 class WebDevToolsAgentImpl FINAL |
71 : public WebDevToolsAgentPrivate | 68 : public WebDevToolsAgentPrivate |
72 , public blink::InspectorClient | 69 , public InspectorClient |
73 , public blink::InspectorFrontendChannel | 70 , public InspectorFrontendChannel |
74 , public WebPageOverlay | 71 , public WebPageOverlay |
75 , private WebThread::TaskObserver { | 72 , private WebThread::TaskObserver { |
76 public: | 73 public: |
77 WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* clien
t); | 74 WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* clien
t); |
78 virtual ~WebDevToolsAgentImpl(); | 75 virtual ~WebDevToolsAgentImpl(); |
79 | 76 |
80 WebDevToolsAgentClient* client() { return m_client; } | 77 WebDevToolsAgentClient* client() { return m_client; } |
81 | 78 |
82 // WebDevToolsAgentPrivate implementation. | 79 // WebDevToolsAgentPrivate implementation. |
83 virtual void didCreateScriptContext(WebLocalFrameImpl*, int worldId) OVERRID
E; | 80 virtual void didCreateScriptContext(WebLocalFrameImpl*, int worldId) OVERRID
E; |
84 virtual bool handleInputEvent(blink::Page*, const WebInputEvent&) OVERRIDE; | 81 virtual bool handleInputEvent(Page*, const WebInputEvent&) OVERRIDE; |
85 virtual void didLayout() OVERRIDE; | 82 virtual void didLayout() OVERRIDE; |
86 | 83 |
87 // WebDevToolsAgent implementation. | 84 // WebDevToolsAgent implementation. |
88 virtual void attach(const WebString& hostId) OVERRIDE; | 85 virtual void attach(const WebString& hostId) OVERRIDE; |
89 virtual void reattach(const WebString& hostId, const WebString& savedState)
OVERRIDE; | 86 virtual void reattach(const WebString& hostId, const WebString& savedState)
OVERRIDE; |
90 virtual void detach() OVERRIDE; | 87 virtual void detach() OVERRIDE; |
91 virtual void continueProgram() OVERRIDE; | 88 virtual void continueProgram() OVERRIDE; |
92 virtual void didBeginFrame(int frameId) OVERRIDE; | 89 virtual void didBeginFrame(int frameId) OVERRIDE; |
93 virtual void didCancelFrame() OVERRIDE; | 90 virtual void didCancelFrame() OVERRIDE; |
94 virtual void willComposite() OVERRIDE; | 91 virtual void willComposite() OVERRIDE; |
95 virtual void didComposite() OVERRIDE; | 92 virtual void didComposite() OVERRIDE; |
96 virtual void dispatchOnInspectorBackend(const WebString& message) OVERRIDE; | 93 virtual void dispatchOnInspectorBackend(const WebString& message) OVERRIDE; |
97 virtual void inspectElementAt(const WebPoint&) OVERRIDE; | 94 virtual void inspectElementAt(const WebPoint&) OVERRIDE; |
98 virtual void evaluateInWebInspector(long callId, const WebString& script) OV
ERRIDE; | 95 virtual void evaluateInWebInspector(long callId, const WebString& script) OV
ERRIDE; |
99 virtual void setLayerTreeId(int) OVERRIDE; | 96 virtual void setLayerTreeId(int) OVERRIDE; |
100 virtual void processGPUEvent(const GPUEvent&) OVERRIDE; | 97 virtual void processGPUEvent(const GPUEvent&) OVERRIDE; |
101 | 98 |
102 // InspectorClient implementation. | 99 // InspectorClient implementation. |
103 virtual void highlight() OVERRIDE; | 100 virtual void highlight() OVERRIDE; |
104 virtual void hideHighlight() OVERRIDE; | 101 virtual void hideHighlight() OVERRIDE; |
105 virtual void updateInspectorStateCookie(const WTF::String&) OVERRIDE; | 102 virtual void updateInspectorStateCookie(const WTF::String&) OVERRIDE; |
106 virtual void sendMessageToFrontend(PassRefPtr<blink::JSONObject> message) OV
ERRIDE; | 103 virtual void sendMessageToFrontend(PassRefPtr<JSONObject> message) OVERRIDE; |
107 virtual void flush() OVERRIDE; | 104 virtual void flush() OVERRIDE; |
108 | 105 |
109 virtual void setDeviceMetricsOverride(int width, int height, float deviceSca
leFactor, bool mobile, bool fitWindow, float scale, float offsetX, float offsetY
) OVERRIDE; | 106 virtual void setDeviceMetricsOverride(int width, int height, float deviceSca
leFactor, bool mobile, bool fitWindow, float scale, float offsetX, float offsetY
) OVERRIDE; |
110 virtual void clearDeviceMetricsOverride() OVERRIDE; | 107 virtual void clearDeviceMetricsOverride() OVERRIDE; |
111 virtual void setTouchEventEmulationEnabled(bool) OVERRIDE; | 108 virtual void setTouchEventEmulationEnabled(bool) OVERRIDE; |
112 | 109 |
113 virtual void getAllocatedObjects(HashSet<const void*>&) OVERRIDE; | 110 virtual void getAllocatedObjects(HashSet<const void*>&) OVERRIDE; |
114 virtual void dumpUncountedAllocatedObjects(const HashMap<const void*, size_t
>&) OVERRIDE; | 111 virtual void dumpUncountedAllocatedObjects(const HashMap<const void*, size_t
>&) OVERRIDE; |
115 virtual void setTraceEventCallback(const WTF::String& categoryFilter, TraceE
ventCallback) OVERRIDE; | 112 virtual void setTraceEventCallback(const WTF::String& categoryFilter, TraceE
ventCallback) OVERRIDE; |
116 virtual void resetTraceEventCallback() OVERRIDE; | 113 virtual void resetTraceEventCallback() OVERRIDE; |
117 virtual void enableTracing(const WTF::String& categoryFilter) OVERRIDE; | 114 virtual void enableTracing(const WTF::String& categoryFilter) OVERRIDE; |
118 virtual void disableTracing() OVERRIDE; | 115 virtual void disableTracing() OVERRIDE; |
119 | 116 |
120 virtual void startGPUEventsRecording() OVERRIDE; | 117 virtual void startGPUEventsRecording() OVERRIDE; |
121 virtual void stopGPUEventsRecording() OVERRIDE; | 118 virtual void stopGPUEventsRecording() OVERRIDE; |
122 | 119 |
123 virtual void dispatchKeyEvent(const blink::PlatformKeyboardEvent&) OVERRIDE; | 120 virtual void dispatchKeyEvent(const PlatformKeyboardEvent&) OVERRIDE; |
124 virtual void dispatchMouseEvent(const blink::PlatformMouseEvent&) OVERRIDE; | 121 virtual void dispatchMouseEvent(const PlatformMouseEvent&) OVERRIDE; |
125 | 122 |
126 // WebPageOverlay | 123 // WebPageOverlay |
127 virtual void paintPageOverlay(WebCanvas*) OVERRIDE; | 124 virtual void paintPageOverlay(WebCanvas*) OVERRIDE; |
128 | 125 |
129 void flushPendingFrontendMessages(); | 126 void flushPendingFrontendMessages(); |
130 | 127 |
131 private: | 128 private: |
132 // WebThread::TaskObserver | 129 // WebThread::TaskObserver |
133 virtual void willProcessTask() OVERRIDE; | 130 virtual void willProcessTask() OVERRIDE; |
134 virtual void didProcessTask() OVERRIDE; | 131 virtual void didProcessTask() OVERRIDE; |
135 | 132 |
136 void enableMobileEmulation(); | 133 void enableMobileEmulation(); |
137 void disableMobileEmulation(); | 134 void disableMobileEmulation(); |
138 void updatePageScaleFactorLimits(); | 135 void updatePageScaleFactorLimits(); |
139 | 136 |
140 blink::InspectorController* inspectorController(); | 137 InspectorController* inspectorController(); |
141 blink::LocalFrame* mainFrame(); | 138 LocalFrame* mainFrame(); |
142 | 139 |
143 int m_debuggerId; | 140 int m_debuggerId; |
144 int m_layerTreeId; | 141 int m_layerTreeId; |
145 WebDevToolsAgentClient* m_client; | 142 WebDevToolsAgentClient* m_client; |
146 WebViewImpl* m_webViewImpl; | 143 WebViewImpl* m_webViewImpl; |
147 bool m_attached; | 144 bool m_attached; |
148 bool m_generatingEvent; | 145 bool m_generatingEvent; |
149 | 146 |
150 bool m_webViewDidLayoutOnceAfterLoad; | 147 bool m_webViewDidLayoutOnceAfterLoad; |
151 | 148 |
152 bool m_deviceMetricsEnabled; | 149 bool m_deviceMetricsEnabled; |
153 bool m_emulateMobileEnabled; | 150 bool m_emulateMobileEnabled; |
154 bool m_originalViewportEnabled; | 151 bool m_originalViewportEnabled; |
155 bool m_isOverlayScrollbarsEnabled; | 152 bool m_isOverlayScrollbarsEnabled; |
156 | 153 |
157 float m_originalMinimumPageScaleFactor; | 154 float m_originalMinimumPageScaleFactor; |
158 float m_originalMaximumPageScaleFactor; | 155 float m_originalMaximumPageScaleFactor; |
159 bool m_pageScaleLimitsOverriden; | 156 bool m_pageScaleLimitsOverriden; |
160 | 157 |
161 bool m_touchEventEmulationEnabled; | 158 bool m_touchEventEmulationEnabled; |
162 OwnPtr<blink::IntPoint> m_lastPinchAnchorCss; | 159 OwnPtr<IntPoint> m_lastPinchAnchorCss; |
163 OwnPtr<blink::IntPoint> m_lastPinchAnchorDip; | 160 OwnPtr<IntPoint> m_lastPinchAnchorDip; |
164 | 161 |
165 typedef Vector<RefPtr<blink::JSONObject> > FrontendMessageQueue; | 162 typedef Vector<RefPtr<JSONObject> > FrontendMessageQueue; |
166 FrontendMessageQueue m_frontendMessageQueue; | 163 FrontendMessageQueue m_frontendMessageQueue; |
167 }; | 164 }; |
168 | 165 |
169 } // namespace blink | 166 } // namespace blink |
170 | 167 |
171 #endif | 168 #endif |
OLD | NEW |