OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 , eventType(eventType) | 76 , eventType(eventType) |
77 , eventListenerVector(eventListenerVector) | 77 , eventListenerVector(eventListenerVector) |
78 { | 78 { |
79 } | 79 } |
80 | 80 |
81 Node* node; | 81 Node* node; |
82 const AtomicString eventType; | 82 const AtomicString eventType; |
83 const EventListenerVector eventListenerVector; | 83 const EventListenerVector eventListenerVector; |
84 }; | 84 }; |
85 | 85 |
86 class InspectorDOMAgent : public InspectorBaseAgent<InspectorDOMAgent>, public I
nspectorBackendDispatcher::DOMCommandHandler { | 86 class InspectorDOMAgent FINAL : public InspectorBaseAgent<InspectorDOMAgent>, pu
blic InspectorBackendDispatcher::DOMCommandHandler { |
87 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); | 87 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); |
88 public: | 88 public: |
89 struct DOMListener { | 89 struct DOMListener { |
90 virtual ~DOMListener() | 90 virtual ~DOMListener() |
91 { | 91 { |
92 } | 92 } |
93 virtual void didRemoveDocument(Document*) = 0; | 93 virtual void didRemoveDocument(Document*) = 0; |
94 virtual void didRemoveDOMNode(Node*) = 0; | 94 virtual void didRemoveDOMNode(Node*) = 0; |
95 virtual void didModifyDOMAttr(Element*) = 0; | 95 virtual void didModifyDOMAttr(Element*) = 0; |
96 }; | 96 }; |
97 | 97 |
98 static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumenti
ngAgents, InspectorPageAgent* pageAgent, InspectorCompositeState* inspectorState
, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay) | 98 static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumenti
ngAgents, InspectorPageAgent* pageAgent, InspectorCompositeState* inspectorState
, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay) |
99 { | 99 { |
100 return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, in
spectorState, injectedScriptManager, overlay)); | 100 return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, in
spectorState, injectedScriptManager, overlay)); |
101 } | 101 } |
102 | 102 |
103 static String toErrorString(ExceptionState&); | 103 static String toErrorString(ExceptionState&); |
104 | 104 |
105 ~InspectorDOMAgent(); | 105 virtual ~InspectorDOMAgent(); |
106 | 106 |
107 virtual void setFrontend(InspectorFrontend*); | 107 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
108 virtual void clearFrontend(); | 108 virtual void clearFrontend() OVERRIDE; |
109 virtual void restore(); | 109 virtual void restore() OVERRIDE; |
110 | 110 |
111 Vector<Document*> documents(); | 111 Vector<Document*> documents(); |
112 void reset(); | 112 void reset(); |
113 | 113 |
114 // Methods called from the frontend for DOM nodes inspection. | 114 // Methods called from the frontend for DOM nodes inspection. |
115 virtual void querySelector(ErrorString*, int nodeId, const String& selectors
, int* elementId); | 115 virtual void querySelector(ErrorString*, int nodeId, const String& selectors
, int* elementId) OVERRIDE; |
116 virtual void querySelectorAll(ErrorString*, int nodeId, const String& select
ors, RefPtr<TypeBuilder::Array<int> >& result); | 116 virtual void querySelectorAll(ErrorString*, int nodeId, const String& select
ors, RefPtr<TypeBuilder::Array<int> >& result) OVERRIDE; |
117 virtual void getDocument(ErrorString*, RefPtr<TypeBuilder::DOM::Node>& root)
; | 117 virtual void getDocument(ErrorString*, RefPtr<TypeBuilder::DOM::Node>& root)
OVERRIDE; |
118 virtual void requestChildNodes(ErrorString*, int nodeId, const int* depth); | 118 virtual void requestChildNodes(ErrorString*, int nodeId, const int* depth) O
VERRIDE; |
119 virtual void setAttributeValue(ErrorString*, int elementId, const String& na
me, const String& value); | 119 virtual void setAttributeValue(ErrorString*, int elementId, const String& na
me, const String& value) OVERRIDE; |
120 virtual void setAttributesAsText(ErrorString*, int elementId, const String&
text, const String* name); | 120 virtual void setAttributesAsText(ErrorString*, int elementId, const String&
text, const String* name) OVERRIDE; |
121 virtual void removeAttribute(ErrorString*, int elementId, const String& name
); | 121 virtual void removeAttribute(ErrorString*, int elementId, const String& name
) OVERRIDE; |
122 virtual void removeNode(ErrorString*, int nodeId); | 122 virtual void removeNode(ErrorString*, int nodeId) OVERRIDE; |
123 virtual void setNodeName(ErrorString*, int nodeId, const String& name, int*
newId); | 123 virtual void setNodeName(ErrorString*, int nodeId, const String& name, int*
newId) OVERRIDE; |
124 virtual void getOuterHTML(ErrorString*, int nodeId, WTF::String* outerHTML); | 124 virtual void getOuterHTML(ErrorString*, int nodeId, WTF::String* outerHTML)
OVERRIDE; |
125 virtual void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML)
; | 125 virtual void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML)
OVERRIDE; |
126 virtual void setNodeValue(ErrorString*, int nodeId, const String& value); | 126 virtual void setNodeValue(ErrorString*, int nodeId, const String& value) OVE
RRIDE; |
127 virtual void getEventListenersForNode(ErrorString*, int nodeId, const WTF::S
tring* objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOM::EventListener> >
& listenersArray); | 127 virtual void getEventListenersForNode(ErrorString*, int nodeId, const WTF::S
tring* objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOM::EventListener> >
& listenersArray) OVERRIDE; |
128 virtual void performSearch(ErrorString*, const String& whitespaceTrimmedQuer
y, String* searchId, int* resultCount); | 128 virtual void performSearch(ErrorString*, const String& whitespaceTrimmedQuer
y, String* searchId, int* resultCount) OVERRIDE; |
129 virtual void getSearchResults(ErrorString*, const String& searchId, int from
Index, int toIndex, RefPtr<TypeBuilder::Array<int> >&); | 129 virtual void getSearchResults(ErrorString*, const String& searchId, int from
Index, int toIndex, RefPtr<TypeBuilder::Array<int> >&) OVERRIDE; |
130 virtual void discardSearchResults(ErrorString*, const String& searchId); | 130 virtual void discardSearchResults(ErrorString*, const String& searchId) OVER
RIDE; |
131 virtual void resolveNode(ErrorString*, int nodeId, const String* objectGroup
, RefPtr<TypeBuilder::Runtime::RemoteObject>& result); | 131 virtual void resolveNode(ErrorString*, int nodeId, const String* objectGroup
, RefPtr<TypeBuilder::Runtime::RemoteObject>& result) OVERRIDE; |
132 virtual void getAttributes(ErrorString*, int nodeId, RefPtr<TypeBuilder::Arr
ay<String> >& result); | 132 virtual void getAttributes(ErrorString*, int nodeId, RefPtr<TypeBuilder::Arr
ay<String> >& result) OVERRIDE; |
133 virtual void setInspectModeEnabled(ErrorString*, bool enabled, const bool* i
nspectShadowDOM, const RefPtr<JSONObject>* highlightConfig); | 133 virtual void setInspectModeEnabled(ErrorString*, bool enabled, const bool* i
nspectShadowDOM, const RefPtr<JSONObject>* highlightConfig) OVERRIDE; |
134 virtual void requestNode(ErrorString*, const String& objectId, int* nodeId); | 134 virtual void requestNode(ErrorString*, const String& objectId, int* nodeId)
OVERRIDE; |
135 virtual void pushNodeByPathToFrontend(ErrorString*, const String& path, int*
nodeId); | 135 virtual void pushNodeByPathToFrontend(ErrorString*, const String& path, int*
nodeId) OVERRIDE; |
136 virtual void pushNodeByBackendIdToFrontend(ErrorString*, BackendNodeId, int*
nodeId); | 136 virtual void pushNodeByBackendIdToFrontend(ErrorString*, BackendNodeId, int*
nodeId) OVERRIDE; |
137 virtual void releaseBackendNodeIds(ErrorString*, const String& nodeGroup); | 137 virtual void releaseBackendNodeIds(ErrorString*, const String& nodeGroup) OV
ERRIDE; |
138 virtual void hideHighlight(ErrorString*); | 138 virtual void hideHighlight(ErrorString*) OVERRIDE; |
139 virtual void highlightRect(ErrorString*, int x, int y, int width, int height
, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor); | 139 virtual void highlightRect(ErrorString*, int x, int y, int width, int height
, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERR
IDE; |
140 virtual void highlightQuad(ErrorString*, const RefPtr<JSONArray>& quad, cons
t RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor); | 140 virtual void highlightQuad(ErrorString*, const RefPtr<JSONArray>& quad, cons
t RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERRIDE; |
141 virtual void highlightNode(ErrorString*, const RefPtr<JSONObject>& highlight
Config, const int* nodeId, const String* objectId); | 141 virtual void highlightNode(ErrorString*, const RefPtr<JSONObject>& highlight
Config, const int* nodeId, const String* objectId) OVERRIDE; |
142 virtual void highlightFrame(ErrorString*, const String& frameId, const RefPt
r<JSONObject>* color, const RefPtr<JSONObject>* outlineColor); | 142 virtual void highlightFrame(ErrorString*, const String& frameId, const RefPt
r<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERRIDE; |
143 | 143 |
144 virtual void moveTo(ErrorString*, int nodeId, int targetNodeId, const int* a
nchorNodeId, int* newNodeId); | 144 virtual void moveTo(ErrorString*, int nodeId, int targetNodeId, const int* a
nchorNodeId, int* newNodeId) OVERRIDE; |
145 virtual void undo(ErrorString*); | 145 virtual void undo(ErrorString*) OVERRIDE; |
146 virtual void redo(ErrorString*); | 146 virtual void redo(ErrorString*) OVERRIDE; |
147 virtual void markUndoableState(ErrorString*); | 147 virtual void markUndoableState(ErrorString*) OVERRIDE; |
148 virtual void focus(ErrorString*, int nodeId); | 148 virtual void focus(ErrorString*, int nodeId) OVERRIDE; |
149 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr
ray>& files); | 149 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr
ray>& files) OVERRIDE; |
150 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::
BoxModel>&); | 150 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::
BoxModel>&) OVERRIDE; |
151 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId); | 151 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) OVE
RRIDE; |
152 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun
daryNodeId); | 152 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun
daryNodeId) OVERRIDE; |
153 | 153 |
154 static void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArr
ay, bool includeAncestors); | 154 static void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArr
ay, bool includeAncestors); |
155 | 155 |
156 // Methods called from the InspectorInstrumentation. | 156 // Methods called from the InspectorInstrumentation. |
157 void setDocument(Document*); | 157 void setDocument(Document*); |
158 void releaseDanglingNodes(); | 158 void releaseDanglingNodes(); |
159 | 159 |
160 void domContentLoadedEventFired(Frame*); | 160 void domContentLoadedEventFired(Frame*); |
161 void didCommitLoad(Frame*, DocumentLoader*); | 161 void didCommitLoad(Frame*, DocumentLoader*); |
162 | 162 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; | 269 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; |
270 OwnPtr<InspectorHistory> m_history; | 270 OwnPtr<InspectorHistory> m_history; |
271 OwnPtr<DOMEditor> m_domEditor; | 271 OwnPtr<DOMEditor> m_domEditor; |
272 bool m_suppressAttributeModifiedEvent; | 272 bool m_suppressAttributeModifiedEvent; |
273 }; | 273 }; |
274 | 274 |
275 | 275 |
276 } // namespace WebCore | 276 } // namespace WebCore |
277 | 277 |
278 #endif // !defined(InspectorDOMAgent_h) | 278 #endif // !defined(InspectorDOMAgent_h) |
OLD | NEW |