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

Unified Diff: ui/aura/gestures/gesture_point.h

Issue 9310031: Event smoothing in CrOS gesture recognizer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixes for clang chromium-style-check. Created 8 years, 10 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 | « ui/aura/aura.gyp ('k') | ui/aura/gestures/gesture_point.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/gestures/gesture_point.h
diff --git a/ui/aura/gestures/gesture_point.h b/ui/aura/gestures/gesture_point.h
index f39d252335b290511529a1271b96b23cc96206a5..3ed8706df4d07df26bef19c799a9a0a8deec932d 100644
--- a/ui/aura/gestures/gesture_point.h
+++ b/ui/aura/gestures/gesture_point.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "ui/aura/gestures/velocity_calculator.h"
#include "ui/gfx/point.h"
namespace aura {
@@ -24,7 +25,7 @@ enum GestureState {
class GesturePoint {
public:
GesturePoint();
- virtual ~GesturePoint() {}
+ ~GesturePoint();
// Resets various states.
void Reset();
@@ -44,7 +45,7 @@ class GesturePoint {
bool IsInClickWindow(const TouchEvent& event) const;
bool IsInDoubleClickWindow(const TouchEvent& event) const;
bool IsInScrollWindow(const TouchEvent& event) const;
- bool IsInFlickWindow(const TouchEvent& event) const;
+ bool IsInFlickWindow(const TouchEvent& event);
bool DidScroll(const TouchEvent& event) const;
const gfx::Point& first_touch_position() const {
@@ -62,8 +63,8 @@ class GesturePoint {
return last_touch_position_.y() - first_touch_position_.y();
}
- float x_velocity() const { return x_velocity_; }
- float y_velocity() const { return y_velocity_; }
+ float XVelocity() { return velocity_calculator_.XVelocity(); }
+ float YVelocity() { return velocity_calculator_.YVelocity(); }
private:
// Various statistical functions to manipulate gestures.
@@ -71,7 +72,7 @@ class GesturePoint {
bool IsInSecondClickTimeWindow() const;
bool IsInsideManhattanSquare(const TouchEvent& event) const;
bool IsSecondClickInsideManhattanSquare(const TouchEvent& event) const;
- bool IsOverMinFlickSpeed() const;
+ bool IsOverMinFlickSpeed();
gfx::Point first_touch_position_;
double first_touch_time_;
@@ -81,9 +82,7 @@ class GesturePoint {
double last_tap_time_;
gfx::Point last_tap_position_;
- float x_velocity_;
- float y_velocity_;
-
+ VelocityCalculator velocity_calculator_;
DISALLOW_COPY_AND_ASSIGN(GesturePoint);
};
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/gestures/gesture_point.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698