| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 REMOTING_CLIENT_FLING_ANIMATION_H_ | 5 #ifndef REMOTING_CLIENT_UI_FLING_ANIMATION_H_ |
| 6 #define REMOTING_CLIENT_FLING_ANIMATION_H_ | 6 #define REMOTING_CLIENT_UI_FLING_ANIMATION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/time/tick_clock.h" | 11 #include "base/time/tick_clock.h" |
| 12 #include "remoting/client/fling_tracker.h" | 12 #include "remoting/client/ui/fling_tracker.h" |
| 13 | 13 |
| 14 namespace remoting { | 14 namespace remoting { |
| 15 | 15 |
| 16 // This class helps interpolating the positions of an object with the given | 16 // This class helps interpolating the positions of an object with the given |
| 17 // initial velocity and feeds the change in position back to the callback. | 17 // initial velocity and feeds the change in position back to the callback. |
| 18 class FlingAnimation { | 18 class FlingAnimation { |
| 19 public: | 19 public: |
| 20 // arguments are delta_x and delta_y with respect to the positions at previous | 20 // arguments are delta_x and delta_y with respect to the positions at previous |
| 21 // tick. | 21 // tick. |
| 22 using FlingCallback = base::Callback<void(float, float)>; | 22 using FlingCallback = base::Callback<void(float, float)>; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 46 base::TimeTicks fling_start_time_; | 46 base::TimeTicks fling_start_time_; |
| 47 | 47 |
| 48 std::unique_ptr<base::TickClock> clock_; | 48 std::unique_ptr<base::TickClock> clock_; |
| 49 | 49 |
| 50 // FlingAnimation is neither copyable nor movable. | 50 // FlingAnimation is neither copyable nor movable. |
| 51 FlingAnimation(const FlingAnimation&) = delete; | 51 FlingAnimation(const FlingAnimation&) = delete; |
| 52 FlingAnimation& operator=(const FlingAnimation&) = delete; | 52 FlingAnimation& operator=(const FlingAnimation&) = delete; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace remoting | 55 } // namespace remoting |
| 56 #endif // REMOTING_CLIENT_FLING_ANIMATION_H_ | 56 #endif // REMOTING_CLIENT_UI_FLING_ANIMATION_H_ |
| OLD | NEW |