Chromium Code Reviews| 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 EventTarget* eventTarget; | 81 EventTarget* eventTarget; |
| 82 const AtomicString eventType; | 82 const AtomicString eventType; |
| 83 const EventListenerVector eventListenerVector; | 83 const EventListenerVector eventListenerVector; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class InspectorDOMAgent FINAL : public InspectorBaseAgent<InspectorDOMAgent>, pu blic InspectorBackendDispatcher::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 : public WillBeGarbageCollectedMixin { | 89 struct DOMListener : public WillBeGarbageCollectedMixin { |
| 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 PassOwnPtrWillBeRawPtr<InspectorDOMAgent> create(InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overl ay) | 98 static PassOwnPtrWillBeRawPtr<InspectorDOMAgent> create(InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overl ay) |
| 99 { | 99 { |
| 100 return adoptPtrWillBeNoop(new InspectorDOMAgent(pageAgent, injectedScrip tManager, overlay)); | 100 return adoptPtrWillBeNoop(new InspectorDOMAgent(pageAgent, injectedScrip tManager, overlay)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static String toErrorString(ExceptionState&); | 103 static String toErrorString(ExceptionState&); |
| 104 | 104 |
| 105 virtual ~InspectorDOMAgent(); | 105 virtual ~InspectorDOMAgent(); |
| 106 virtual void trace(Visitor*) OVERRIDE; | 106 virtual void trace(Visitor*) override; |
| 107 | 107 |
| 108 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 108 virtual void setFrontend(InspectorFrontend*) override; |
| 109 virtual void clearFrontend() OVERRIDE; | 109 virtual void clearFrontend() override; |
| 110 virtual void restore() OVERRIDE; | 110 virtual void restore() override; |
| 111 | 111 |
| 112 WillBeHeapVector<RawPtrWillBeMember<Document> > documents(); | 112 WillBeHeapVector<RawPtrWillBeMember<Document> > documents(); |
| 113 void reset(); | 113 void reset(); |
| 114 | 114 |
| 115 // Methods called from the frontend for DOM nodes inspection. | 115 // Methods called from the frontend for DOM nodes inspection. |
| 116 virtual void enable(ErrorString*) OVERRIDE; | 116 virtual void enable(ErrorString*) override; |
| 117 virtual void disable(ErrorString*) OVERRIDE; | 117 virtual void disable(ErrorString*) override; |
| 118 virtual void querySelector(ErrorString*, int nodeId, const String& selectors , int* elementId) OVERRIDE; | 118 virtual void querySelector(ErrorString*, int nodeId, const String& selectors , int* elementId) override; |
| 119 virtual void querySelectorAll(ErrorString*, int nodeId, const String& select ors, RefPtr<TypeBuilder::Array<int> >& result) OVERRIDE; | 119 virtual void querySelectorAll(ErrorString*, int nodeId, const String& select ors, RefPtr<TypeBuilder::Array<int> >& result) override; |
| 120 virtual void getDocument(ErrorString*, RefPtr<TypeBuilder::DOM::Node>& root) OVERRIDE; | 120 virtual void getDocument(ErrorString*, RefPtr<TypeBuilder::DOM::Node>& root) override; |
| 121 virtual void requestChildNodes(ErrorString*, int nodeId, const int* depth) O VERRIDE; | 121 virtual void requestChildNodes(ErrorString*, int nodeId, const int* depth) o verride; |
| 122 virtual void setAttributeValue(ErrorString*, int elementId, const String& na me, const String& value) OVERRIDE; | 122 virtual void setAttributeValue(ErrorString*, int elementId, const String& na me, const String& value) override; |
| 123 virtual void setAttributesAsText(ErrorString*, int elementId, const String& text, const String* name) OVERRIDE; | 123 virtual void setAttributesAsText(ErrorString*, int elementId, const String& text, const String* name) override; |
| 124 virtual void removeAttribute(ErrorString*, int elementId, const String& name ) OVERRIDE; | 124 virtual void removeAttribute(ErrorString*, int elementId, const String& name ) override; |
| 125 virtual void removeNode(ErrorString*, int nodeId) OVERRIDE; | 125 virtual void removeNode(ErrorString*, int nodeId) override; |
| 126 virtual void setNodeName(ErrorString*, int nodeId, const String& name, int* newId) OVERRIDE; | 126 virtual void setNodeName(ErrorString*, int nodeId, const String& name, int* newId) override; |
| 127 virtual void getOuterHTML(ErrorString*, int nodeId, WTF::String* outerHTML) OVERRIDE; | 127 virtual void getOuterHTML(ErrorString*, int nodeId, WTF::String* outerHTML) override; |
| 128 virtual void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML) OVERRIDE; | 128 virtual void setOuterHTML(ErrorString*, int nodeId, const String& outerHTML) override; |
| 129 virtual void setNodeValue(ErrorString*, int nodeId, const String& value) OVE RRIDE; | 129 virtual void setNodeValue(ErrorString*, int nodeId, const String& value) ove rride; |
| 130 virtual void getEventListenersForNode(ErrorString*, int nodeId, const WTF::S tring* objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOM::EventListener> > & listenersArray) OVERRIDE; | 130 virtual void getEventListenersForNode(ErrorString*, int nodeId, const WTF::S tring* objectGroup, RefPtr<TypeBuilder::Array<TypeBuilder::DOM::EventListener> > & listenersArray) override; |
| 131 virtual void performSearch(ErrorString*, const String& whitespaceTrimmedQuer y, const bool* includeUserAgentShadowDOM, String* searchId, int* resultCount) OV ERRIDE; | 131 virtual void performSearch(ErrorString*, const String& whitespaceTrimmedQuer y, const bool* includeUserAgentShadowDOM, String* searchId, int* resultCount) ov erride; |
| 132 virtual void getSearchResults(ErrorString*, const String& searchId, int from Index, int toIndex, RefPtr<TypeBuilder::Array<int> >&) OVERRIDE; | 132 virtual void getSearchResults(ErrorString*, const String& searchId, int from Index, int toIndex, RefPtr<TypeBuilder::Array<int> >&) override; |
| 133 virtual void discardSearchResults(ErrorString*, const String& searchId) OVER RIDE; | 133 virtual void discardSearchResults(ErrorString*, const String& searchId) over ride; |
| 134 virtual void resolveNode(ErrorString*, int nodeId, const String* objectGroup , RefPtr<TypeBuilder::Runtime::RemoteObject>& result) OVERRIDE; | 134 virtual void resolveNode(ErrorString*, int nodeId, const String* objectGroup , RefPtr<TypeBuilder::Runtime::RemoteObject>& result) override; |
| 135 virtual void getAttributes(ErrorString*, int nodeId, RefPtr<TypeBuilder::Arr ay<String> >& result) OVERRIDE; | 135 virtual void getAttributes(ErrorString*, int nodeId, RefPtr<TypeBuilder::Arr ay<String> >& result) override; |
| 136 virtual void setInspectModeEnabled(ErrorString*, bool enabled, const bool* i nspectUAShadowDOM, const RefPtr<JSONObject>* highlightConfig) OVERRIDE; | 136 virtual void setInspectModeEnabled(ErrorString*, bool enabled, const bool* i nspectUAShadowDOM, const RefPtr<JSONObject>* highlightConfig) override; |
| 137 virtual void requestNode(ErrorString*, const String& objectId, int* nodeId) OVERRIDE; | 137 virtual void requestNode(ErrorString*, const String& objectId, int* nodeId) override; |
| 138 virtual void pushNodeByPathToFrontend(ErrorString*, const String& path, int* nodeId) OVERRIDE; | 138 virtual void pushNodeByPathToFrontend(ErrorString*, const String& path, int* nodeId) override; |
| 139 virtual void pushNodesByBackendIdsToFrontend(ErrorString*, const RefPtr<JSON Array>& nodeIds, RefPtr<TypeBuilder::Array<int> >&) OVERRIDE; | 139 virtual void pushNodesByBackendIdsToFrontend(ErrorString*, const RefPtr<JSON Array>& nodeIds, RefPtr<TypeBuilder::Array<int> >&) override; |
| 140 virtual void hideHighlight(ErrorString*) OVERRIDE; | 140 virtual void hideHighlight(ErrorString*) override; |
| 141 virtual void highlightRect(ErrorString*, int x, int y, int width, int height , const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERR IDE; | 141 virtual void highlightRect(ErrorString*, int x, int y, int width, int height , const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) overr ide; |
| 142 virtual void highlightQuad(ErrorString*, const RefPtr<JSONArray>& quad, cons t RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERRIDE; | 142 virtual void highlightQuad(ErrorString*, const RefPtr<JSONArray>& quad, cons t RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) override; |
| 143 virtual void highlightNode(ErrorString*, const RefPtr<JSONObject>& highlight Config, const int* nodeId, const String* objectId) OVERRIDE; | 143 virtual void highlightNode(ErrorString*, const RefPtr<JSONObject>& highlight Config, const int* nodeId, const String* objectId) override; |
| 144 virtual void highlightFrame(ErrorString*, const String& frameId, const RefPt r<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) OVERRIDE; | 144 virtual void highlightFrame(ErrorString*, const String& frameId, const RefPt r<JSONObject>* color, const RefPtr<JSONObject>* outlineColor) override; |
| 145 | 145 |
| 146 virtual void copyTo(ErrorString*, int nodeId, int targetElementId, const int * anchorNodeId, int* newNodeId) OVERRIDE; | 146 virtual void copyTo(ErrorString*, int nodeId, int targetElementId, const int * anchorNodeId, int* newNodeId) override; |
| 147 virtual void moveTo(ErrorString*, int nodeId, int targetNodeId, const int* a nchorNodeId, int* newNodeId) OVERRIDE; | 147 virtual void moveTo(ErrorString*, int nodeId, int targetNodeId, const int* a nchorNodeId, int* newNodeId) override; |
| 148 virtual void undo(ErrorString*) OVERRIDE; | 148 virtual void undo(ErrorString*) override; |
| 149 virtual void redo(ErrorString*) OVERRIDE; | 149 virtual void redo(ErrorString*) override; |
| 150 virtual void markUndoableState(ErrorString*) OVERRIDE; | 150 virtual void markUndoableState(ErrorString*) override; |
| 151 virtual void focus(ErrorString*, int nodeId) OVERRIDE; | 151 virtual void focus(ErrorString*, int nodeId) override; |
| 152 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr ray>& files) OVERRIDE; | 152 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr ray>& files) override; |
| 153 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM:: BoxModel>&) OVERRIDE; | 153 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM:: BoxModel>&) override; |
| 154 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) OVE RRIDE; | 154 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) ove rride; |
| 155 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun daryNodeId) OVERRIDE; | 155 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun daryNodeId) override; |
|
Mike West
2014/10/07 13:37:15
Nit: Trailing whitespace?
| |
| 156 | 156 |
| 157 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste nersArray, bool includeAncestors); | 157 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste nersArray, bool includeAncestors); |
| 158 | 158 |
| 159 class Listener : public WillBeGarbageCollectedMixin { | 159 class Listener : public WillBeGarbageCollectedMixin { |
| 160 public: | 160 public: |
| 161 virtual ~Listener() { } | 161 virtual ~Listener() { } |
| 162 virtual void domAgentWasEnabled() = 0; | 162 virtual void domAgentWasEnabled() = 0; |
| 163 virtual void domAgentWasDisabled() = 0; | 163 virtual void domAgentWasDisabled() = 0; |
| 164 }; | 164 }; |
| 165 void setListener(Listener* listener) { m_listener = listener; } | 165 void setListener(Listener* listener) { m_listener = listener; } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 OwnPtrWillBeMember<InspectorHistory> m_history; | 277 OwnPtrWillBeMember<InspectorHistory> m_history; |
| 278 OwnPtrWillBeMember<DOMEditor> m_domEditor; | 278 OwnPtrWillBeMember<DOMEditor> m_domEditor; |
| 279 bool m_suppressAttributeModifiedEvent; | 279 bool m_suppressAttributeModifiedEvent; |
| 280 RawPtrWillBeMember<Listener> m_listener; | 280 RawPtrWillBeMember<Listener> m_listener; |
| 281 }; | 281 }; |
| 282 | 282 |
| 283 | 283 |
| 284 } // namespace blink | 284 } // namespace blink |
| 285 | 285 |
| 286 #endif // !defined(InspectorDOMAgent_h) | 286 #endif // !defined(InspectorDOMAgent_h) |
| OLD | NEW |