Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef InspectorAnimationAgent_h | 5 #ifndef InspectorAnimationAgent_h |
| 6 #define InspectorAnimationAgent_h | 6 #define InspectorAnimationAgent_h |
| 7 | 7 |
| 8 #include "core/InspectorFrontend.h" | 8 #include "core/InspectorFrontend.h" |
| 9 #include "core/css/CSSKeyframesRule.h" | 9 #include "core/css/CSSKeyframesRule.h" |
| 10 #include "core/inspector/InspectorBaseAgent.h" | 10 #include "core/inspector/InspectorBaseAgent.h" |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class AnimationNode; | 16 class AnimationNode; |
| 17 class AnimationPlayer; | 17 class AnimationPlayer; |
| 18 class AnimationTimeline; | 18 class AnimationTimeline; |
| 19 class Element; | 19 class Element; |
| 20 class InspectorDOMAgent; | 20 class InspectorDOMAgent; |
|
yurys
2015/04/24 08:54:40
class LocalFrame;
| |
| 21 class InspectorPageAgent; | |
| 22 class TimingFunction; | 21 class TimingFunction; |
| 23 | 22 |
| 24 class InspectorAnimationAgent final : public InspectorBaseAgent<InspectorAnimati onAgent, InspectorFrontend::Animation>, public InspectorBackendDispatcher::Anima tionCommandHandler { | 23 class InspectorAnimationAgent final : public InspectorBaseAgent<InspectorAnimati onAgent, InspectorFrontend::Animation>, public InspectorBackendDispatcher::Anima tionCommandHandler { |
| 25 WTF_MAKE_NONCOPYABLE(InspectorAnimationAgent); | 24 WTF_MAKE_NONCOPYABLE(InspectorAnimationAgent); |
| 26 public: | 25 public: |
| 27 static PassOwnPtrWillBeRawPtr<InspectorAnimationAgent> create(InspectorPageA gent* pageAgent, InspectorDOMAgent* domAgent) | 26 static PassOwnPtrWillBeRawPtr<InspectorAnimationAgent> create(LocalFrame* in spectedFrame, InspectorDOMAgent* domAgent) |
| 28 { | 27 { |
| 29 return adoptPtrWillBeNoop(new InspectorAnimationAgent(pageAgent, domAgen t)); | 28 return adoptPtrWillBeNoop(new InspectorAnimationAgent(inspectedFrame, do mAgent)); |
| 30 } | 29 } |
| 31 | 30 |
| 32 // Base agent methods. | 31 // Base agent methods. |
| 33 void restore() override; | 32 void restore() override; |
| 34 void disable(ErrorString*) override; | 33 void disable(ErrorString*) override; |
| 35 void didCommitLoadForLocalFrame(LocalFrame*) override; | 34 void didCommitLoadForLocalFrame(LocalFrame*) override; |
| 36 | 35 |
| 37 // Protocol method implementations | 36 // Protocol method implementations |
| 38 virtual void getAnimationPlayersForNode(ErrorString*, int nodeId, bool inclu deSubtreeAnimations, RefPtr<TypeBuilder::Array<TypeBuilder::Animation::Animation Player> >& animationPlayersArray) override; | 37 virtual void getAnimationPlayersForNode(ErrorString*, int nodeId, bool inclu deSubtreeAnimations, RefPtr<TypeBuilder::Array<TypeBuilder::Animation::Animation Player> >& animationPlayersArray) override; |
| 39 virtual void getPlaybackRate(ErrorString*, double* playbackRate) override; | 38 virtual void getPlaybackRate(ErrorString*, double* playbackRate) override; |
| 40 virtual void setPlaybackRate(ErrorString*, double playbackRate) override; | 39 virtual void setPlaybackRate(ErrorString*, double playbackRate) override; |
| 41 virtual void setCurrentTime(ErrorString*, double currentTime) override; | 40 virtual void setCurrentTime(ErrorString*, double currentTime) override; |
| 42 virtual void setTiming(ErrorString*, const String& playerId, double duration , double delay) override; | 41 virtual void setTiming(ErrorString*, const String& playerId, double duration , double delay) override; |
| 43 | 42 |
| 44 // API for InspectorInstrumentation | 43 // API for InspectorInstrumentation |
| 45 void didCreateAnimationPlayer(AnimationPlayer*); | 44 void didCreateAnimationPlayer(AnimationPlayer*); |
| 46 void didCancelAnimationPlayer(AnimationPlayer*); | 45 void didCancelAnimationPlayer(AnimationPlayer*); |
| 47 void didClearDocumentOfWindowObject(LocalFrame*); | 46 void didClearDocumentOfWindowObject(LocalFrame*); |
| 48 | 47 |
| 49 // API for InspectorFrontend | 48 // API for InspectorFrontend |
| 50 virtual void enable(ErrorString*) override; | 49 virtual void enable(ErrorString*) override; |
| 51 | 50 |
| 52 // Methods for other agents to use. | 51 // Methods for other agents to use. |
| 53 AnimationPlayer* assertAnimationPlayer(ErrorString*, const String& id); | 52 AnimationPlayer* assertAnimationPlayer(ErrorString*, const String& id); |
| 54 | 53 |
| 55 DECLARE_VIRTUAL_TRACE(); | 54 DECLARE_VIRTUAL_TRACE(); |
| 56 | 55 |
| 57 private: | 56 private: |
| 58 InspectorAnimationAgent(InspectorPageAgent*, InspectorDOMAgent*); | 57 InspectorAnimationAgent(LocalFrame*, InspectorDOMAgent*); |
| 59 | 58 |
| 60 typedef TypeBuilder::Animation::AnimationPlayer::Type::Enum AnimationType; | 59 typedef TypeBuilder::Animation::AnimationPlayer::Type::Enum AnimationType; |
| 61 | 60 |
| 62 PassRefPtr<TypeBuilder::Animation::AnimationPlayer> buildObjectForAnimationP layer(AnimationPlayer&); | 61 PassRefPtr<TypeBuilder::Animation::AnimationPlayer> buildObjectForAnimationP layer(AnimationPlayer&); |
| 63 PassRefPtr<TypeBuilder::Animation::AnimationPlayer> buildObjectForAnimationP layer(AnimationPlayer&, AnimationType, PassRefPtr<TypeBuilder::Animation::Keyfra mesRule> keyframeRule = nullptr); | 62 PassRefPtr<TypeBuilder::Animation::AnimationPlayer> buildObjectForAnimationP layer(AnimationPlayer&, AnimationType, PassRefPtr<TypeBuilder::Animation::Keyfra mesRule> keyframeRule = nullptr); |
| 64 PassRefPtr<TypeBuilder::Array<TypeBuilder::Animation::AnimationPlayer> > bui ldArrayForAnimationPlayers(Element&, const WillBeHeapVector<RefPtrWillBeMember<A nimationPlayer> >); | 63 PassRefPtr<TypeBuilder::Array<TypeBuilder::Animation::AnimationPlayer> > bui ldArrayForAnimationPlayers(Element&, const WillBeHeapVector<RefPtrWillBeMember<A nimationPlayer> >); |
| 65 double normalizedStartTime(AnimationPlayer&); | 64 double normalizedStartTime(AnimationPlayer&); |
| 66 AnimationTimeline& referenceTimeline(); | 65 AnimationTimeline& referenceTimeline(); |
| 67 | 66 |
| 68 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 67 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; |
| 69 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; | 68 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; |
| 70 WillBeHeapHashMap<String, RefPtrWillBeMember<AnimationPlayer>> m_idToAnimati onPlayer; | 69 WillBeHeapHashMap<String, RefPtrWillBeMember<AnimationPlayer>> m_idToAnimati onPlayer; |
| 71 WillBeHeapHashMap<String, AnimationType> m_idToAnimationType; | 70 WillBeHeapHashMap<String, AnimationType> m_idToAnimationType; |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } | 73 } |
| 75 | 74 |
| 76 #endif // InspectorAnimationAgent_h | 75 #endif // InspectorAnimationAgent_h |
| OLD | NEW |