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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 virtual void redo(ErrorString*) OVERRIDE; | 147 virtual void redo(ErrorString*) OVERRIDE; |
148 virtual void markUndoableState(ErrorString*) OVERRIDE; | 148 virtual void markUndoableState(ErrorString*) OVERRIDE; |
149 virtual void focus(ErrorString*, int nodeId) OVERRIDE; | 149 virtual void focus(ErrorString*, int nodeId) OVERRIDE; |
150 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr
ray>& files) OVERRIDE; | 150 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr
ray>& files) OVERRIDE; |
151 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::
BoxModel>&) OVERRIDE; | 151 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::
BoxModel>&) OVERRIDE; |
152 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) OVE
RRIDE; | 152 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) OVE
RRIDE; |
153 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun
daryNodeId) OVERRIDE; | 153 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun
daryNodeId) OVERRIDE; |
154 | 154 |
155 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste
nersArray, bool includeAncestors); | 155 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste
nersArray, bool includeAncestors); |
156 | 156 |
| 157 class Listener { |
| 158 public: |
| 159 virtual ~Listener() { } |
| 160 virtual void domAgentWasEnabled() = 0; |
| 161 virtual void domAgentWasDisabled() = 0; |
| 162 }; |
| 163 void setListener(Listener* listener) { m_listener = listener; } |
| 164 |
| 165 bool enabled() const; |
| 166 |
157 // Methods called from the InspectorInstrumentation. | 167 // Methods called from the InspectorInstrumentation. |
158 void setDocument(Document*); | 168 void setDocument(Document*); |
159 void releaseDanglingNodes(); | 169 void releaseDanglingNodes(); |
160 | 170 |
161 void domContentLoadedEventFired(LocalFrame*); | 171 void domContentLoadedEventFired(LocalFrame*); |
162 void didCommitLoad(LocalFrame*, DocumentLoader*); | 172 void didCommitLoad(LocalFrame*, DocumentLoader*); |
163 | 173 |
164 void didInsertDOMNode(Node*); | 174 void didInsertDOMNode(Node*); |
165 void willRemoveDOMNode(Node*); | 175 void willRemoveDOMNode(Node*); |
166 void willModifyDOMAttr(Element*, const AtomicString& oldValue, const AtomicS
tring& newValue); | 176 void willModifyDOMAttr(Element*, const AtomicString& oldValue, const AtomicS
tring& newValue); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 210 |
201 Node* assertNode(ErrorString*, int nodeId); | 211 Node* assertNode(ErrorString*, int nodeId); |
202 Element* assertElement(ErrorString*, int nodeId); | 212 Element* assertElement(ErrorString*, int nodeId); |
203 Document* assertDocument(ErrorString*, int nodeId); | 213 Document* assertDocument(ErrorString*, int nodeId); |
204 | 214 |
205 private: | 215 private: |
206 enum SearchMode { NotSearching, SearchingForNormal, SearchingForUAShadow }; | 216 enum SearchMode { NotSearching, SearchingForNormal, SearchingForUAShadow }; |
207 | 217 |
208 InspectorDOMAgent(InspectorPageAgent*, InjectedScriptManager*, InspectorOver
lay*); | 218 InspectorDOMAgent(InspectorPageAgent*, InjectedScriptManager*, InspectorOver
lay*); |
209 | 219 |
210 bool enabled() const; | |
211 void setSearchingForNode(ErrorString*, SearchMode, JSONObject* highlightConf
ig); | 220 void setSearchingForNode(ErrorString*, SearchMode, JSONObject* highlightConf
ig); |
212 PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*,
JSONObject* highlightInspectorObject); | 221 PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*,
JSONObject* highlightInspectorObject); |
213 | 222 |
214 // Node-related methods. | 223 // Node-related methods. |
215 typedef HashMap<RefPtr<Node>, int> NodeToIdMap; | 224 typedef HashMap<RefPtr<Node>, int> NodeToIdMap; |
216 int bind(Node*, NodeToIdMap*); | 225 int bind(Node*, NodeToIdMap*); |
217 void unbind(Node*, NodeToIdMap*); | 226 void unbind(Node*, NodeToIdMap*); |
218 | 227 |
219 Node* assertEditableNode(ErrorString*, int nodeId); | 228 Node* assertEditableNode(ErrorString*, int nodeId); |
220 Element* assertEditableElement(ErrorString*, int nodeId); | 229 Element* assertEditableElement(ErrorString*, int nodeId); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 int m_lastNodeId; | 268 int m_lastNodeId; |
260 RefPtr<Document> m_document; | 269 RefPtr<Document> m_document; |
261 typedef HashMap<String, Vector<RefPtr<Node> > > SearchResults; | 270 typedef HashMap<String, Vector<RefPtr<Node> > > SearchResults; |
262 SearchResults m_searchResults; | 271 SearchResults m_searchResults; |
263 OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; | 272 OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; |
264 SearchMode m_searchingForNode; | 273 SearchMode m_searchingForNode; |
265 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; | 274 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; |
266 OwnPtr<InspectorHistory> m_history; | 275 OwnPtr<InspectorHistory> m_history; |
267 OwnPtr<DOMEditor> m_domEditor; | 276 OwnPtr<DOMEditor> m_domEditor; |
268 bool m_suppressAttributeModifiedEvent; | 277 bool m_suppressAttributeModifiedEvent; |
| 278 Listener* m_listener; |
269 }; | 279 }; |
270 | 280 |
271 | 281 |
272 } // namespace WebCore | 282 } // namespace WebCore |
273 | 283 |
274 #endif // !defined(InspectorDOMAgent_h) | 284 #endif // !defined(InspectorDOMAgent_h) |
OLD | NEW |