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

Unified Diff: remoting/client/fling_animation.h

Issue 2879383002: [CRD iOS] Move UI stuff into a subdirectory (Closed)
Patch Set: Fix include Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/direct_input_strategy.cc ('k') | remoting/client/fling_animation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/fling_animation.h
diff --git a/remoting/client/fling_animation.h b/remoting/client/fling_animation.h
deleted file mode 100644
index c7672e99ebe6967ed9ebbc95aafbf60ee6c0b0de..0000000000000000000000000000000000000000
--- a/remoting/client/fling_animation.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef REMOTING_CLIENT_FLING_ANIMATION_H_
-#define REMOTING_CLIENT_FLING_ANIMATION_H_
-
-#include <memory>
-
-#include "base/callback.h"
-#include "base/time/tick_clock.h"
-#include "remoting/client/fling_tracker.h"
-
-namespace remoting {
-
-// This class helps interpolating the positions of an object with the given
-// initial velocity and feeds the change in position back to the callback.
-class FlingAnimation {
- public:
- // arguments are delta_x and delta_y with respect to the positions at previous
- // tick.
- using FlingCallback = base::Callback<void(float, float)>;
-
- FlingAnimation(float time_constant, const FlingCallback& fling_callback);
- ~FlingAnimation();
-
- // (Re)starts the fling animation with the given initial velocity.
- void SetVelocity(float velocity_x, float velocity_y);
-
- bool IsAnimationInProgress() const;
-
- // Moves forward the animation to catch up with current time. Calls the fling
- // callback with the new positions. No-op if fling animation is not in
- // progress.
- void Tick();
-
- // Aborts the animation.
- void Abort();
-
- void SetTickClockForTest(std::unique_ptr<base::TickClock> clock);
-
- private:
- FlingTracker fling_tracker_;
- FlingCallback fling_callback_;
-
- base::TimeTicks fling_start_time_;
-
- std::unique_ptr<base::TickClock> clock_;
-
- // FlingAnimation is neither copyable nor movable.
- FlingAnimation(const FlingAnimation&) = delete;
- FlingAnimation& operator=(const FlingAnimation&) = delete;
-};
-
-} // namespace remoting
-#endif // REMOTING_CLIENT_FLING_ANIMATION_H_
« no previous file with comments | « remoting/client/direct_input_strategy.cc ('k') | remoting/client/fling_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698