| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 class InspectorHistory; | 63 class InspectorHistory; |
| 64 class Node; | 64 class Node; |
| 65 class QualifiedName; | 65 class QualifiedName; |
| 66 class PseudoElement; | 66 class PseudoElement; |
| 67 class PlatformGestureEvent; | 67 class PlatformGestureEvent; |
| 68 class PlatformMouseEvent; | 68 class PlatformMouseEvent; |
| 69 class PlatformTouchEvent; | 69 class PlatformTouchEvent; |
| 70 class InspectorRevalidateDOMTask; | 70 class InspectorRevalidateDOMTask; |
| 71 class ShadowRoot; | 71 class ShadowRoot; |
| 72 | 72 |
| 73 typedef String ErrorString; | |
| 74 | |
| 75 class CORE_EXPORT InspectorDOMAgent final : public InspectorBaseAgent<InspectorD
OMAgent, protocol::Frontend::DOM>, public protocol::Dispatcher::DOMCommandHandle
r { | 73 class CORE_EXPORT InspectorDOMAgent final : public InspectorBaseAgent<InspectorD
OMAgent, protocol::Frontend::DOM>, public protocol::Dispatcher::DOMCommandHandle
r { |
| 76 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); | 74 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); |
| 77 public: | 75 public: |
| 78 struct CORE_EXPORT DOMListener : public WillBeGarbageCollectedMixin { | 76 struct CORE_EXPORT DOMListener : public WillBeGarbageCollectedMixin { |
| 79 virtual ~DOMListener() | 77 virtual ~DOMListener() |
| 80 { | 78 { |
| 81 } | 79 } |
| 82 virtual void didRemoveDocument(Document*) = 0; | 80 virtual void didRemoveDocument(Document*) = 0; |
| 83 virtual void didRemoveDOMNode(Node*) = 0; | 81 virtual void didRemoveDOMNode(Node*) = 0; |
| 84 virtual void didModifyDOMAttr(Element*) = 0; | 82 virtual void didModifyDOMAttr(Element*) = 0; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void setNodeValue(ErrorString*, int nodeId, const String& value) override; | 122 void setNodeValue(ErrorString*, int nodeId, const String& value) override; |
| 125 void removeNode(ErrorString*, int nodeId) override; | 123 void removeNode(ErrorString*, int nodeId) override; |
| 126 void setAttributeValue(ErrorString*, int nodeId, const String& name, const S
tring& value) override; | 124 void setAttributeValue(ErrorString*, int nodeId, const String& name, const S
tring& value) override; |
| 127 void setAttributesAsText(ErrorString*, int nodeId, const String& text, const
Maybe<String>& name) override; | 125 void setAttributesAsText(ErrorString*, int nodeId, const String& text, const
Maybe<String>& name) override; |
| 128 void removeAttribute(ErrorString*, int nodeId, const String& name) override; | 126 void removeAttribute(ErrorString*, int nodeId, const String& name) override; |
| 129 void getOuterHTML(ErrorString*, int nodeId, String* outerHTML) override; | 127 void getOuterHTML(ErrorString*, int nodeId, String* outerHTML) override; |
| 130 void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML) overrid
e; | 128 void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML) overrid
e; |
| 131 void performSearch(ErrorString*, const String& query, const Maybe<bool>& inc
ludeUserAgentShadowDOM, String* searchId, int* resultCount) override; | 129 void performSearch(ErrorString*, const String& query, const Maybe<bool>& inc
ludeUserAgentShadowDOM, String* searchId, int* resultCount) override; |
| 132 void getSearchResults(ErrorString*, const String& searchId, int fromIndex, i
nt toIndex, OwnPtr<protocol::Array<int>>* nodeIds) override; | 130 void getSearchResults(ErrorString*, const String& searchId, int fromIndex, i
nt toIndex, OwnPtr<protocol::Array<int>>* nodeIds) override; |
| 133 void discardSearchResults(ErrorString*, const String& searchId) override; | 131 void discardSearchResults(ErrorString*, const String& searchId) override; |
| 134 void requestNode(ErrorString*, const String& objectId, int* outNodeId) overr
ide; | 132 void requestNode(ErrorString*, const String16& objectId, int* outNodeId) ove
rride; |
| 135 void setInspectMode(ErrorString*, const String& mode, const Maybe<protocol::
DOM::HighlightConfig>&) override; | 133 void setInspectMode(ErrorString*, const String& mode, const Maybe<protocol::
DOM::HighlightConfig>&) override; |
| 136 void highlightRect(ErrorString*, int x, int y, int width, int height, const
Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlineColo
r) override; | 134 void highlightRect(ErrorString*, int x, int y, int width, int height, const
Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlineColo
r) override; |
| 137 void highlightQuad(ErrorString*, PassOwnPtr<protocol::Array<double>> quad, c
onst Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlin
eColor) override; | 135 void highlightQuad(ErrorString*, PassOwnPtr<protocol::Array<double>> quad, c
onst Maybe<protocol::DOM::RGBA>& color, const Maybe<protocol::DOM::RGBA>& outlin
eColor) override; |
| 138 void highlightNode(ErrorString*, PassOwnPtr<protocol::DOM::HighlightConfig>,
const Maybe<int>& nodeId, const Maybe<int>& backendNodeId, const Maybe<String>&
objectId) override; | 136 void highlightNode(ErrorString*, PassOwnPtr<protocol::DOM::HighlightConfig>,
const Maybe<int>& nodeId, const Maybe<int>& backendNodeId, const Maybe<String16
>& objectId) override; |
| 139 void hideHighlight(ErrorString*) override; | 137 void hideHighlight(ErrorString*) override; |
| 140 void highlightFrame(ErrorString*, const String& frameId, const Maybe<protoco
l::DOM::RGBA>& contentColor, const Maybe<protocol::DOM::RGBA>& contentOutlineCol
or) override; | 138 void highlightFrame(ErrorString*, const String& frameId, const Maybe<protoco
l::DOM::RGBA>& contentColor, const Maybe<protocol::DOM::RGBA>& contentOutlineCol
or) override; |
| 141 void pushNodeByPathToFrontend(ErrorString*, const String& path, int* outNode
Id) override; | 139 void pushNodeByPathToFrontend(ErrorString*, const String& path, int* outNode
Id) override; |
| 142 void pushNodesByBackendIdsToFrontend(ErrorString*, PassOwnPtr<protocol::Arra
y<int>> backendNodeIds, OwnPtr<protocol::Array<int>>* nodeIds) override; | 140 void pushNodesByBackendIdsToFrontend(ErrorString*, PassOwnPtr<protocol::Arra
y<int>> backendNodeIds, OwnPtr<protocol::Array<int>>* nodeIds) override; |
| 143 void setInspectedNode(ErrorString*, int nodeId) override; | 141 void setInspectedNode(ErrorString*, int nodeId) override; |
| 144 void resolveNode(ErrorString*, int nodeId, const Maybe<String>& objectGroup,
OwnPtr<protocol::Runtime::RemoteObject>*) override; | 142 void resolveNode(ErrorString*, int nodeId, const Maybe<String>& objectGroup,
OwnPtr<protocol::Runtime::RemoteObject>*) override; |
| 145 void getAttributes(ErrorString*, int nodeId, OwnPtr<protocol::Array<String>>
* attributes) override; | 143 void getAttributes(ErrorString*, int nodeId, OwnPtr<protocol::Array<String>>
* attributes) override; |
| 146 void copyTo(ErrorString*, int nodeId, int targetNodeId, const Maybe<int>& in
sertBeforeNodeId, int* outNodeId) override; | 144 void copyTo(ErrorString*, int nodeId, int targetNodeId, const Maybe<int>& in
sertBeforeNodeId, int* outNodeId) override; |
| 147 void moveTo(ErrorString*, int nodeId, int targetNodeId, const Maybe<int>& in
sertBeforeNodeId, int* outNodeId) override; | 145 void moveTo(ErrorString*, int nodeId, int targetNodeId, const Maybe<int>& in
sertBeforeNodeId, int* outNodeId) override; |
| 148 void undo(ErrorString*) override; | 146 void undo(ErrorString*) override; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 177 void pseudoElementDestroyed(PseudoElement*); | 175 void pseudoElementDestroyed(PseudoElement*); |
| 178 | 176 |
| 179 Node* nodeForId(int nodeId); | 177 Node* nodeForId(int nodeId); |
| 180 int boundNodeId(Node*); | 178 int boundNodeId(Node*); |
| 181 void setDOMListener(DOMListener*); | 179 void setDOMListener(DOMListener*); |
| 182 void inspect(Node*); | 180 void inspect(Node*); |
| 183 void nodeHighlightedInOverlay(Node*); | 181 void nodeHighlightedInOverlay(Node*); |
| 184 | 182 |
| 185 static String documentURLString(Document*); | 183 static String documentURLString(Document*); |
| 186 | 184 |
| 187 PassOwnPtr<protocol::Runtime::RemoteObject> resolveNode(Node*, const String&
objectGroup); | 185 PassOwnPtr<protocol::Runtime::RemoteObject> resolveNode(Node*, const String1
6& objectGroup); |
| 188 | 186 |
| 189 InspectorHistory* history() { return m_history.get(); } | 187 InspectorHistory* history() { return m_history.get(); } |
| 190 | 188 |
| 191 // We represent embedded doms as a part of the same hierarchy. Hence we trea
t children of frame owners differently. | 189 // We represent embedded doms as a part of the same hierarchy. Hence we trea
t children of frame owners differently. |
| 192 // We also skip whitespace text nodes conditionally. Following methods encap
sulate these specifics. | 190 // We also skip whitespace text nodes conditionally. Following methods encap
sulate these specifics. |
| 193 static Node* innerFirstChild(Node*); | 191 static Node* innerFirstChild(Node*); |
| 194 static Node* innerNextSibling(Node*); | 192 static Node* innerNextSibling(Node*); |
| 195 static Node* innerPreviousSibling(Node*); | 193 static Node* innerPreviousSibling(Node*); |
| 196 static unsigned innerChildNodeCount(Node*); | 194 static unsigned innerChildNodeCount(Node*); |
| 197 static Node* innerParentNode(Node*); | 195 static Node* innerParentNode(Node*); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 OwnPtrWillBeMember<InspectorHistory> m_history; | 261 OwnPtrWillBeMember<InspectorHistory> m_history; |
| 264 OwnPtrWillBeMember<DOMEditor> m_domEditor; | 262 OwnPtrWillBeMember<DOMEditor> m_domEditor; |
| 265 bool m_suppressAttributeModifiedEvent; | 263 bool m_suppressAttributeModifiedEvent; |
| 266 int m_backendNodeIdToInspect; | 264 int m_backendNodeIdToInspect; |
| 267 }; | 265 }; |
| 268 | 266 |
| 269 | 267 |
| 270 } // namespace blink | 268 } // namespace blink |
| 271 | 269 |
| 272 #endif // !defined(InspectorDOMAgent_h) | 270 #endif // !defined(InspectorDOMAgent_h) |
| OLD | NEW |