Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | |
| 3 * Use of this source code is governed by a BSD-style license that can be | |
| 4 * found in the LICENSE file. | |
|
vsevik
2014/10/16 08:13:52
// Copyright 2014 The Chromium Authors. All rights
samli
2014/10/16 22:59:30
Done.
| |
| 5 */ | |
| 6 | |
| 7 #ifndef InspectorAnimationAgent_h | |
| 8 #define InspectorAnimationAgent_h | |
| 9 | |
| 10 #include "core/InspectorFrontend.h" | |
| 11 #include "core/inspector/InspectorBaseAgent.h" | |
| 12 #include "wtf/PassOwnPtr.h" | |
| 13 #include "wtf/text/WTFString.h" | |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class AnimationNode; | |
| 18 class AnimationPlayer; | |
| 19 class InspectorDOMAgent; | |
| 20 | |
| 21 class InspectorAnimationAgent final : public InspectorBaseAgent<InspectorAnimati onAgent>, public InspectorBackendDispatcher::AnimationCommandHandler { | |
| 22 WTF_MAKE_NONCOPYABLE(InspectorAnimationAgent); | |
| 23 public: | |
| 24 static PassOwnPtrWillBeRawPtr<InspectorAnimationAgent> create(InspectorDOMAg ent* domAgent) | |
| 25 { | |
| 26 return adoptPtrWillBeNoop(new InspectorAnimationAgent(domAgent)); | |
| 27 } | |
| 28 | |
| 29 // Base agent methods. | |
| 30 virtual void setFrontend(InspectorFrontend*) override; | |
| 31 virtual void clearFrontend() override; | |
| 32 void reset(); | |
| 33 | |
| 34 // Protocol method implementations. | |
| 35 virtual void getAnimationPlayersForNode(ErrorString*, int nodeId, RefPtr<Typ eBuilder::Array<TypeBuilder::Animation::AnimationPlayer> >& animationPlayersArra y) override; | |
| 36 virtual void pauseAnimationPlayer(ErrorString*, const String& id, RefPtr<Typ eBuilder::Animation::AnimationPlayer>&) override; | |
| 37 virtual void playAnimationPlayer(ErrorString*, const String& id, RefPtr<Type Builder::Animation::AnimationPlayer>&) override; | |
| 38 virtual void setAnimationPlayerCurrentTime(ErrorString*, const String& id, d ouble currentTime, RefPtr<TypeBuilder::Animation::AnimationPlayer>&) override; | |
| 39 virtual void getAnimationPlayerState(ErrorString*, const String& id, double* currentTime, bool* isRunning) override; | |
| 40 | |
| 41 // Methods for other agents to use. | |
| 42 AnimationPlayer* assertAnimationPlayer(ErrorString*, const String& id); | |
| 43 | |
| 44 virtual void trace(Visitor*) override; | |
| 45 | |
| 46 private: | |
| 47 InspectorAnimationAgent(InspectorDOMAgent*); | |
| 48 | |
| 49 String playerId(AnimationPlayer&); | |
| 50 | |
| 51 PassRefPtr<TypeBuilder::Animation::AnimationPlayer> buildObjectForAnimationP layer(AnimationPlayer&); | |
| 52 PassRefPtr<TypeBuilder::Animation::AnimationNode> buildObjectForAnimationNod e(AnimationNode&); | |
| 53 | |
| 54 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; | |
| 55 InspectorFrontend::Animation* m_frontend; | |
| 56 WillBeHeapHashMap<String, RefPtrWillBeMember<AnimationPlayer> > m_idToAnimat ionPlayer; | |
| 57 }; | |
| 58 | |
| 59 } | |
| 60 | |
| 61 #endif // InspectorAnimationAgent_h | |
| OLD | NEW |