Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.h

Issue 620783002: Devtools Animations: Basic animation inspection & control in Styles pane (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove keyframe view Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 virtual void getAnimationPlayersForNode(ErrorString*, int nodeId, RefPtr<Typ eBuilder::Array<TypeBuilder::DOM::AnimationPlayer> >& animationPlayersArray) ove rride;
146 virtual void pauseAnimationPlayer(ErrorString*, const String& id, RefPtr<Typ eBuilder::DOM::AnimationPlayer>&) override;
147 virtual void playAnimationPlayer(ErrorString*, const String& id, RefPtr<Type Builder::DOM::AnimationPlayer>&) override;
148 virtual void setAnimationPlayerCurrentTime(ErrorString*, const String& id, d ouble currentTime, RefPtr<TypeBuilder::DOM::AnimationPlayer>&) override;
149 virtual void getAnimationPlayerState(ErrorString*, const String& id, double* currentTime, bool* isRunning) override;
145 150
146 virtual void copyTo(ErrorString*, int nodeId, int targetElementId, const int * anchorNodeId, int* newNodeId) override; 151 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; 152 virtual void moveTo(ErrorString*, int nodeId, int targetNodeId, const int* a nchorNodeId, int* newNodeId) override;
148 virtual void undo(ErrorString*) override; 153 virtual void undo(ErrorString*) override;
149 virtual void redo(ErrorString*) override; 154 virtual void redo(ErrorString*) override;
150 virtual void markUndoableState(ErrorString*) override; 155 virtual void markUndoableState(ErrorString*) override;
151 virtual void focus(ErrorString*, int nodeId) override; 156 virtual void focus(ErrorString*, int nodeId) override;
152 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr ray>& files) override; 157 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr ray>& files) override;
153 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM:: BoxModel>&) override; 158 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM:: BoxModel>&) override;
154 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) ove rride; 159 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) ove rride;
155 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun daryNodeId) override; 160 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun daryNodeId) override;
161
156 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste nersArray, bool includeAncestors); 162 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste nersArray, bool includeAncestors);
157 163
158 class Listener : public WillBeGarbageCollectedMixin { 164 class Listener : public WillBeGarbageCollectedMixin {
159 public: 165 public:
160 virtual ~Listener() { } 166 virtual ~Listener() { }
161 virtual void domAgentWasEnabled() = 0; 167 virtual void domAgentWasEnabled() = 0;
162 virtual void domAgentWasDisabled() = 0; 168 virtual void domAgentWasDisabled() = 0;
163 }; 169 };
164 void setListener(Listener* listener) { m_listener = listener; } 170 void setListener(Listener* listener) { m_listener = listener; }
165 171
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 static Node* innerFirstChild(Node*); 211 static Node* innerFirstChild(Node*);
206 static Node* innerNextSibling(Node*); 212 static Node* innerNextSibling(Node*);
207 static Node* innerPreviousSibling(Node*); 213 static Node* innerPreviousSibling(Node*);
208 static unsigned innerChildNodeCount(Node*); 214 static unsigned innerChildNodeCount(Node*);
209 static Node* innerParentNode(Node*); 215 static Node* innerParentNode(Node*);
210 static bool isWhitespace(Node*); 216 static bool isWhitespace(Node*);
211 217
212 Node* assertNode(ErrorString*, int nodeId); 218 Node* assertNode(ErrorString*, int nodeId);
213 Element* assertElement(ErrorString*, int nodeId); 219 Element* assertElement(ErrorString*, int nodeId);
214 Document* assertDocument(ErrorString*, int nodeId); 220 Document* assertDocument(ErrorString*, int nodeId);
221 AnimationPlayer* assertAnimationPlayer(ErrorString*, const String& id);
215 222
216 private: 223 private:
217 enum SearchMode { NotSearching, SearchingForNormal, SearchingForUAShadow }; 224 enum SearchMode { NotSearching, SearchingForNormal, SearchingForUAShadow };
218 225
219 InspectorDOMAgent(InspectorPageAgent*, InjectedScriptManager*, InspectorOver lay*); 226 InspectorDOMAgent(InspectorPageAgent*, InjectedScriptManager*, InspectorOver lay*);
220 227
221 void innerEnable(); 228 void innerEnable();
222 void notifyDocumentUpdated(); 229 void notifyDocumentUpdated();
223 230
224 void setSearchingForNode(ErrorString*, SearchMode, JSONObject* highlightConf ig); 231 void setSearchingForNode(ErrorString*, SearchMode, JSONObject* highlightConf ig);
(...skipping 13 matching lines...) Expand all
238 int pushNodePathToFrontend(Node*); 245 int pushNodePathToFrontend(Node*);
239 void pushChildNodesToFrontend(int nodeId, int depth = 1); 246 void pushChildNodesToFrontend(int nodeId, int depth = 1);
240 247
241 void invalidateFrameOwnerElement(LocalFrame*); 248 void invalidateFrameOwnerElement(LocalFrame*);
242 249
243 PassRefPtr<TypeBuilder::DOM::Node> buildObjectForNode(Node*, int depth, Node ToIdMap*); 250 PassRefPtr<TypeBuilder::DOM::Node> buildObjectForNode(Node*, int depth, Node ToIdMap*);
244 PassRefPtr<TypeBuilder::Array<String> > buildArrayForElementAttributes(Eleme nt*); 251 PassRefPtr<TypeBuilder::Array<String> > buildArrayForElementAttributes(Eleme nt*);
245 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForContain erChildren(Node* container, int depth, NodeToIdMap* nodesMap); 252 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForContain erChildren(Node* container, int depth, NodeToIdMap* nodesMap);
246 PassRefPtr<TypeBuilder::DOM::EventListener> buildObjectForEventListener(cons t RegisteredEventListener&, const AtomicString& eventType, Node*, const String* objectGroupId); 253 PassRefPtr<TypeBuilder::DOM::EventListener> buildObjectForEventListener(cons t RegisteredEventListener&, const AtomicString& eventType, Node*, const String* objectGroupId);
247 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForPseudoE lements(Element*, NodeToIdMap* nodesMap); 254 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForPseudoE lements(Element*, NodeToIdMap* nodesMap);
255 PassRefPtr<TypeBuilder::DOM::AnimationPlayer> buildObjectForAnimationPlayer( AnimationPlayer&);
256 PassRefPtr<TypeBuilder::DOM::AnimationNode> buildObjectForAnimationNode(Anim ationNode&);
248 257
249 Node* nodeForPath(const String& path); 258 Node* nodeForPath(const String& path);
250 259
251 void discardFrontendBindings(); 260 void discardFrontendBindings();
252 261
253 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col or, const RefPtr<JSONObject>* outlineColor); 262 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col or, const RefPtr<JSONObject>* outlineColor);
254 263
255 bool pushDocumentUponHandlelessOperation(ErrorString*); 264 bool pushDocumentUponHandlelessOperation(ErrorString*);
256 265
266 static String playerId(AnimationPlayer& player) { return String::number(play er.sequenceNumber()); }
vsevik 2014/10/14 09:08:08 I don't think we should inline it.
samli 2014/10/15 08:46:44 Done.
267
257 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; 268 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
258 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; 269 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
259 InspectorOverlay* m_overlay; 270 InspectorOverlay* m_overlay;
260 InspectorFrontend::DOM* m_frontend; 271 InspectorFrontend::DOM* m_frontend;
261 RawPtrWillBeMember<DOMListener> m_domListener; 272 RawPtrWillBeMember<DOMListener> m_domListener;
262 OwnPtrWillBeMember<NodeToIdMap> m_documentNodeToIdMap; 273 OwnPtrWillBeMember<NodeToIdMap> m_documentNodeToIdMap;
263 // Owns node mappings for dangling nodes. 274 // Owns node mappings for dangling nodes.
264 WillBeHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps; 275 WillBeHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps;
265 WillBeHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode; 276 WillBeHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode;
266 WillBeHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap; 277 WillBeHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap;
267 HashSet<int> m_childrenRequested; 278 HashSet<int> m_childrenRequested;
268 HashMap<int, int> m_cachedChildCount; 279 HashMap<int, int> m_cachedChildCount;
269 int m_lastNodeId; 280 int m_lastNodeId;
270 RefPtrWillBeMember<Document> m_document; 281 RefPtrWillBeMember<Document> m_document;
271 typedef WillBeHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMember<Node> > > SearchResults; 282 typedef WillBeHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMember<Node> > > SearchResults;
272 SearchResults m_searchResults; 283 SearchResults m_searchResults;
273 OwnPtrWillBeMember<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; 284 OwnPtrWillBeMember<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
274 SearchMode m_searchingForNode; 285 SearchMode m_searchingForNode;
275 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; 286 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig;
276 OwnPtrWillBeMember<InspectorHistory> m_history; 287 OwnPtrWillBeMember<InspectorHistory> m_history;
277 OwnPtrWillBeMember<DOMEditor> m_domEditor; 288 OwnPtrWillBeMember<DOMEditor> m_domEditor;
278 bool m_suppressAttributeModifiedEvent; 289 bool m_suppressAttributeModifiedEvent;
279 RawPtrWillBeMember<Listener> m_listener; 290 RawPtrWillBeMember<Listener> m_listener;
291 WillBeHeapHashMap<String, RefPtrWillBeMember<AnimationPlayer> > m_idToAnimat ionPlayer;
280 }; 292 };
281 293
282 294
283 } // namespace blink 295 } // namespace blink
284 296
285 #endif // !defined(InspectorDOMAgent_h) 297 #endif // !defined(InspectorDOMAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698