Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 #ifndef SmoothScrollSequencer_h | |
| 5 #define SmoothScrollSequencer_h | |
| 6 | |
| 7 #include <utility> | |
| 8 #include <vector> | |
| 9 #include "platform/scroll/ProgrammaticScrollAnimatorClient.h" | |
| 10 #include "platform/scroll/ScrollTypes.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 class ScrollableArea; | |
| 15 | |
| 16 class PLATFORM_EXPORT SmoothScrollSequencer | |
|
bokan
2017/04/07 15:56:52
Please add a class-level comment about what this c
sunyunjia
2017/05/12 18:40:25
Done.
| |
| 17 : public ProgrammaticScrollAnimatorClient { | |
| 18 public: | |
| 19 static SmoothScrollSequencer* create(); | |
| 20 | |
| 21 ~SmoothScrollSequencer(); | |
| 22 | |
| 23 // Add a scroll offset animation to the back of a queue. | |
| 24 void queueAnimation(ScrollableArea*, ScrollOffset); | |
| 25 | |
| 26 // Run the animation at the back of the queue and sets itself as a client | |
| 27 // of ProgrammaticScrollAnimator to receive finish notification. | |
| 28 void runQueuedAnimations(); | |
| 29 | |
| 30 // Pop the back of the queue and run the next animation in the queue. | |
| 31 void notifyAnimationFinished(); | |
| 32 | |
| 33 // Abort the currently running anmation and all the animations in the queue. | |
| 34 void abortAnimations(); | |
| 35 | |
| 36 protected: | |
| 37 explicit SmoothScrollSequencer(); | |
|
bokan
2017/04/07 15:56:52
There's no argument here so there's no implicit co
sunyunjia
2017/05/12 18:40:25
Done.
| |
| 38 | |
| 39 private: | |
| 40 typedef std::pair<Member<ScrollableArea>, ScrollOffset> ScrollerAndOffsetPair; | |
| 41 std::vector<ScrollerAndOffsetPair> m_queue; | |
| 42 }; | |
| 43 | |
| 44 } // namespace blink | |
| 45 | |
| 46 #endif // SmoothScrollSequencer_h | |
| OLD | NEW |