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 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class KURL; | 56 class KURL; |
57 class LayoutRect; | 57 class LayoutRect; |
58 class Page; | 58 class Page; |
59 class RenderObject; | 59 class RenderObject; |
60 class SharedBuffer; | 60 class SharedBuffer; |
61 class StyleResolver; | 61 class StyleResolver; |
62 class TextResourceDecoder; | 62 class TextResourceDecoder; |
63 | 63 |
64 typedef String ErrorString; | 64 typedef String ErrorString; |
65 | 65 |
66 class InspectorPageAgent FINAL : public InspectorBaseAgent<InspectorPageAgent>,
public InspectorBackendDispatcher::PageCommandHandler { | 66 class InspectorPageAgent final : public InspectorBaseAgent<InspectorPageAgent>,
public InspectorBackendDispatcher::PageCommandHandler { |
67 WTF_MAKE_NONCOPYABLE(InspectorPageAgent); | 67 WTF_MAKE_NONCOPYABLE(InspectorPageAgent); |
68 public: | 68 public: |
69 enum ResourceType { | 69 enum ResourceType { |
70 DocumentResource, | 70 DocumentResource, |
71 StylesheetResource, | 71 StylesheetResource, |
72 ImageResource, | 72 ImageResource, |
73 FontResource, | 73 FontResource, |
74 MediaResource, | 74 MediaResource, |
75 ScriptResource, | 75 ScriptResource, |
76 TextTrackResource, | 76 TextTrackResource, |
(...skipping 14 matching lines...) Expand all Loading... |
91 static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& text
EncodingName, bool withBase64Encode, String* result); | 91 static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& text
EncodingName, bool withBase64Encode, String* result); |
92 | 92 |
93 static PassRefPtr<SharedBuffer> resourceData(LocalFrame*, const KURL&, Strin
g* textEncodingName); | 93 static PassRefPtr<SharedBuffer> resourceData(LocalFrame*, const KURL&, Strin
g* textEncodingName); |
94 static Resource* cachedResource(LocalFrame*, const KURL&); | 94 static Resource* cachedResource(LocalFrame*, const KURL&); |
95 static TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType); | 95 static TypeBuilder::Page::ResourceType::Enum resourceTypeJson(ResourceType); |
96 static ResourceType cachedResourceType(const Resource&); | 96 static ResourceType cachedResourceType(const Resource&); |
97 static TypeBuilder::Page::ResourceType::Enum cachedResourceTypeJson(const Re
source&); | 97 static TypeBuilder::Page::ResourceType::Enum cachedResourceTypeJson(const Re
source&); |
98 static PassOwnPtr<TextResourceDecoder> createResourceTextDecoder(const Strin
g& mimeType, const String& textEncodingName); | 98 static PassOwnPtr<TextResourceDecoder> createResourceTextDecoder(const Strin
g& mimeType, const String& textEncodingName); |
99 | 99 |
100 // Page API for InspectorFrontend | 100 // Page API for InspectorFrontend |
101 virtual void enable(ErrorString*) OVERRIDE; | 101 virtual void enable(ErrorString*) override; |
102 virtual void disable(ErrorString*) OVERRIDE; | 102 virtual void disable(ErrorString*) override; |
103 virtual void addScriptToEvaluateOnLoad(ErrorString*, const String& source, S
tring* result) OVERRIDE; | 103 virtual void addScriptToEvaluateOnLoad(ErrorString*, const String& source, S
tring* result) override; |
104 virtual void removeScriptToEvaluateOnLoad(ErrorString*, const String& identi
fier) OVERRIDE; | 104 virtual void removeScriptToEvaluateOnLoad(ErrorString*, const String& identi
fier) override; |
105 virtual void reload(ErrorString*, const bool* optionalIgnoreCache, const Str
ing* optionalScriptToEvaluateOnLoad, const String* optionalScriptPreprocessor) O
VERRIDE; | 105 virtual void reload(ErrorString*, const bool* optionalIgnoreCache, const Str
ing* optionalScriptToEvaluateOnLoad, const String* optionalScriptPreprocessor) o
verride; |
106 virtual void navigate(ErrorString*, const String& url, String* frameId) OVER
RIDE; | 106 virtual void navigate(ErrorString*, const String& url, String* frameId) over
ride; |
107 virtual void getCookies(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder:
:Page::Cookie> >& cookies) OVERRIDE; | 107 virtual void getCookies(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder:
:Page::Cookie> >& cookies) override; |
108 virtual void deleteCookie(ErrorString*, const String& cookieName, const Stri
ng& url) OVERRIDE; | 108 virtual void deleteCookie(ErrorString*, const String& cookieName, const Stri
ng& url) override; |
109 virtual void getResourceTree(ErrorString*, RefPtr<TypeBuilder::Page::FrameRe
sourceTree>&) OVERRIDE; | 109 virtual void getResourceTree(ErrorString*, RefPtr<TypeBuilder::Page::FrameRe
sourceTree>&) override; |
110 virtual void getResourceContent(ErrorString*, const String& frameId, const S
tring& url, PassRefPtrWillBeRawPtr<GetResourceContentCallback>) OVERRIDE; | 110 virtual void getResourceContent(ErrorString*, const String& frameId, const S
tring& url, PassRefPtrWillBeRawPtr<GetResourceContentCallback>) override; |
111 virtual void searchInResource(ErrorString*, const String& frameId, const Str
ing& url, const String& query, const bool* optionalCaseSensitive, const bool* op
tionalIsRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) OVE
RRIDE; | 111 virtual void searchInResource(ErrorString*, const String& frameId, const Str
ing& url, const String& query, const bool* optionalCaseSensitive, const bool* op
tionalIsRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) ove
rride; |
112 virtual void setDocumentContent(ErrorString*, const String& frameId, const S
tring& html) OVERRIDE; | 112 virtual void setDocumentContent(ErrorString*, const String& frameId, const S
tring& html) override; |
113 virtual void setDeviceMetricsOverride(ErrorString*, int width, int height, d
ouble deviceScaleFactor, bool mobile, bool fitWindow, const double* optionalScal
e, const double* optionalOffsetX, const double* optionalOffsetY) OVERRIDE; | 113 virtual void setDeviceMetricsOverride(ErrorString*, int width, int height, d
ouble deviceScaleFactor, bool mobile, bool fitWindow, const double* optionalScal
e, const double* optionalOffsetX, const double* optionalOffsetY) override; |
114 virtual void clearDeviceMetricsOverride(ErrorString*) OVERRIDE; | 114 virtual void clearDeviceMetricsOverride(ErrorString*) override; |
115 virtual void resetScrollAndPageScaleFactor(ErrorString*) OVERRIDE; | 115 virtual void resetScrollAndPageScaleFactor(ErrorString*) override; |
116 virtual void setPageScaleFactor(ErrorString*, double pageScaleFactor) OVERRI
DE; | 116 virtual void setPageScaleFactor(ErrorString*, double pageScaleFactor) overri
de; |
117 virtual void setShowPaintRects(ErrorString*, bool show) OVERRIDE; | 117 virtual void setShowPaintRects(ErrorString*, bool show) override; |
118 virtual void setShowDebugBorders(ErrorString*, bool show) OVERRIDE; | 118 virtual void setShowDebugBorders(ErrorString*, bool show) override; |
119 virtual void setShowFPSCounter(ErrorString*, bool show) OVERRIDE; | 119 virtual void setShowFPSCounter(ErrorString*, bool show) override; |
120 virtual void setContinuousPaintingEnabled(ErrorString*, bool enabled) OVERRI
DE; | 120 virtual void setContinuousPaintingEnabled(ErrorString*, bool enabled) overri
de; |
121 virtual void setShowScrollBottleneckRects(ErrorString*, bool show) OVERRIDE; | 121 virtual void setShowScrollBottleneckRects(ErrorString*, bool show) override; |
122 virtual void getScriptExecutionStatus(ErrorString*, PageCommandHandler::Resu
lt::Enum*) OVERRIDE; | 122 virtual void getScriptExecutionStatus(ErrorString*, PageCommandHandler::Resu
lt::Enum*) override; |
123 virtual void setScriptExecutionDisabled(ErrorString*, bool) OVERRIDE; | 123 virtual void setScriptExecutionDisabled(ErrorString*, bool) override; |
124 virtual void setTouchEmulationEnabled(ErrorString*, bool) OVERRIDE; | 124 virtual void setTouchEmulationEnabled(ErrorString*, bool) override; |
125 virtual void setEmulatedMedia(ErrorString*, const String&) OVERRIDE; | 125 virtual void setEmulatedMedia(ErrorString*, const String&) override; |
126 virtual void startScreencast(ErrorString*, const String* format, const int*
quality, const int* maxWidth, const int* maxHeight) OVERRIDE; | 126 virtual void startScreencast(ErrorString*, const String* format, const int*
quality, const int* maxWidth, const int* maxHeight) override; |
127 virtual void stopScreencast(ErrorString*) OVERRIDE; | 127 virtual void stopScreencast(ErrorString*) override; |
128 virtual void setShowViewportSizeOnResize(ErrorString*, bool show, const bool
* showGrid) OVERRIDE; | 128 virtual void setShowViewportSizeOnResize(ErrorString*, bool show, const bool
* showGrid) override; |
129 | 129 |
130 // InspectorInstrumentation API | 130 // InspectorInstrumentation API |
131 void didClearDocumentOfWindowObject(LocalFrame*); | 131 void didClearDocumentOfWindowObject(LocalFrame*); |
132 void domContentLoadedEventFired(LocalFrame*); | 132 void domContentLoadedEventFired(LocalFrame*); |
133 void loadEventFired(LocalFrame*); | 133 void loadEventFired(LocalFrame*); |
134 void didCommitLoad(LocalFrame*, DocumentLoader*); | 134 void didCommitLoad(LocalFrame*, DocumentLoader*); |
135 void frameAttachedToParent(LocalFrame*); | 135 void frameAttachedToParent(LocalFrame*); |
136 void frameDetachedFromParent(LocalFrame*); | 136 void frameDetachedFromParent(LocalFrame*); |
137 void loaderDetachedFromFrame(DocumentLoader*); | 137 void loaderDetachedFromFrame(DocumentLoader*); |
138 void frameStartedLoading(LocalFrame*); | 138 void frameStartedLoading(LocalFrame*); |
139 void frameStoppedLoading(LocalFrame*); | 139 void frameStoppedLoading(LocalFrame*); |
140 void frameScheduledNavigation(LocalFrame*, double delay); | 140 void frameScheduledNavigation(LocalFrame*, double delay); |
141 void frameClearedScheduledNavigation(LocalFrame*); | 141 void frameClearedScheduledNavigation(LocalFrame*); |
142 void willRunJavaScriptDialog(const String& message); | 142 void willRunJavaScriptDialog(const String& message); |
143 void didRunJavaScriptDialog(); | 143 void didRunJavaScriptDialog(); |
144 bool applyViewportStyleOverride(StyleResolver*); | 144 bool applyViewportStyleOverride(StyleResolver*); |
145 void applyEmulatedMedia(String*); | 145 void applyEmulatedMedia(String*); |
146 void didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext*, const L
ayoutRect&); | 146 void didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext*, const L
ayoutRect&); |
147 void didLayout(RenderObject*); | 147 void didLayout(RenderObject*); |
148 void didScroll(); | 148 void didScroll(); |
149 void didResizeMainFrame(); | 149 void didResizeMainFrame(); |
150 void didRecalculateStyle(int); | 150 void didRecalculateStyle(int); |
151 void scriptsEnabled(bool isEnabled); | 151 void scriptsEnabled(bool isEnabled); |
152 | 152 |
153 // Inspector Controller API | 153 // Inspector Controller API |
154 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 154 virtual void setFrontend(InspectorFrontend*) override; |
155 virtual void clearFrontend() OVERRIDE; | 155 virtual void clearFrontend() override; |
156 virtual void restore() OVERRIDE; | 156 virtual void restore() override; |
157 virtual void discardAgent() OVERRIDE; | 157 virtual void discardAgent() override; |
158 | 158 |
159 // Cross-agents API | 159 // Cross-agents API |
160 Page* page() { return m_page; } | 160 Page* page() { return m_page; } |
161 LocalFrame* mainFrame(); | 161 LocalFrame* mainFrame(); |
162 String createIdentifier(); | 162 String createIdentifier(); |
163 LocalFrame* frameForId(const String& frameId); | 163 LocalFrame* frameForId(const String& frameId); |
164 String frameId(LocalFrame*); | 164 String frameId(LocalFrame*); |
165 bool hasIdForFrame(LocalFrame*) const; | 165 bool hasIdForFrame(LocalFrame*) const; |
166 String loaderId(DocumentLoader*); | 166 String loaderId(DocumentLoader*); |
167 LocalFrame* findFrameWithSecurityOrigin(const String& originRawString); | 167 LocalFrame* findFrameWithSecurityOrigin(const String& originRawString); |
168 LocalFrame* assertFrame(ErrorString*, const String& frameId); | 168 LocalFrame* assertFrame(ErrorString*, const String& frameId); |
169 String scriptPreprocessorSource() { return m_scriptPreprocessorSource; } | 169 String scriptPreprocessorSource() { return m_scriptPreprocessorSource; } |
170 const AtomicString& resourceSourceMapURL(const String& url); | 170 const AtomicString& resourceSourceMapURL(const String& url); |
171 bool deviceMetricsOverrideEnabled(); | 171 bool deviceMetricsOverrideEnabled(); |
172 void deviceOrPageScaleFactorChanged(); | 172 void deviceOrPageScaleFactorChanged(); |
173 bool screencastEnabled(); | 173 bool screencastEnabled(); |
174 static DocumentLoader* assertDocumentLoader(ErrorString*, LocalFrame*); | 174 static DocumentLoader* assertDocumentLoader(ErrorString*, LocalFrame*); |
175 InspectorResourceContentLoader* resourceContentLoader() { return m_inspector
ResourceContentLoader.get(); } | 175 InspectorResourceContentLoader* resourceContentLoader() { return m_inspector
ResourceContentLoader.get(); } |
176 void clearEditedResourcesContent(); | 176 void clearEditedResourcesContent(); |
177 void addEditedResourceContent(const String& url, const String& content); | 177 void addEditedResourceContent(const String& url, const String& content); |
178 bool getEditedResourceContent(const String& url, String* content); | 178 bool getEditedResourceContent(const String& url, String* content); |
179 | 179 |
180 virtual void trace(Visitor*) OVERRIDE; | 180 virtual void trace(Visitor*) override; |
181 | 181 |
182 private: | 182 private: |
183 class GetResourceContentLoadListener; | 183 class GetResourceContentLoadListener; |
184 | 184 |
185 InspectorPageAgent(Page*, InjectedScriptManager*, InspectorClient*, Inspecto
rOverlay*); | 185 InspectorPageAgent(Page*, InjectedScriptManager*, InspectorClient*, Inspecto
rOverlay*); |
186 bool deviceMetricsChanged(bool enabled, int width, int height, double device
ScaleFactor, bool mobile, bool fitWindow, double scale, double offsetX, double o
ffsetY); | 186 bool deviceMetricsChanged(bool enabled, int width, int height, double device
ScaleFactor, bool mobile, bool fitWindow, double scale, double offsetX, double o
ffsetY); |
187 void updateViewMetricsFromState(); | 187 void updateViewMetricsFromState(); |
188 void updateViewMetrics(bool enabled, int width, int height, double deviceSca
leFactor, bool mobile, bool fitWindow, double scale, double offsetX, double offs
etY); | 188 void updateViewMetrics(bool enabled, int width, int height, double deviceSca
leFactor, bool mobile, bool fitWindow, double scale, double offsetX, double offs
etY); |
189 void updateTouchEventEmulationInPage(bool); | 189 void updateTouchEventEmulationInPage(bool); |
190 bool compositingEnabled(ErrorString*); | 190 bool compositingEnabled(ErrorString*); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 OwnPtrWillBeMember<InspectorResourceContentLoader> m_inspectorResourceConten
tLoader; | 228 OwnPtrWillBeMember<InspectorResourceContentLoader> m_inspectorResourceConten
tLoader; |
229 HashMap<String, String> m_editedResourceContent; | 229 HashMap<String, String> m_editedResourceContent; |
230 }; | 230 }; |
231 | 231 |
232 | 232 |
233 } // namespace blink | 233 } // namespace blink |
234 | 234 |
235 | 235 |
236 #endif // !defined(InspectorPagerAgent_h) | 236 #endif // !defined(InspectorPagerAgent_h) |
OLD | NEW |