| Index: ash/laser/laser_pointer_points.h
|
| diff --git a/ash/laser/laser_pointer_points.h b/ash/laser/laser_pointer_points.h
|
| index 19e95c1d1b3b1d6598cf47fb5483be7a9d153813..e28a9aeda0f664416608e6a8329e38ded3fd3f99 100644
|
| --- a/ash/laser/laser_pointer_points.h
|
| +++ b/ash/laser/laser_pointer_points.h
|
| @@ -23,7 +23,9 @@ class ASH_EXPORT LaserPointerPoints {
|
| // Struct to describe each point.
|
| struct LaserPoint {
|
| gfx::Point location;
|
| - base::Time creation_time;
|
| + // age is a value between [0,1] where 0 means the point was just added and 1
|
| + // means that the point is just about to be removed.
|
| + double age;
|
| };
|
|
|
| // Constructor with a parameter to choose the fade out time of the points in
|
| @@ -33,6 +35,9 @@ class ASH_EXPORT LaserPointerPoints {
|
|
|
| // Adds a point. Automatically clears points that are too old.
|
| void AddPoint(const gfx::Point& point);
|
| + // Updates the collection latest time. Automatically clears points that are
|
| + // too old.
|
| + void MoveForwardToTime(const base::Time& latest_time);
|
| // Removes all points.
|
| void Clear();
|
| // Gets the bounding box of the points.
|
| @@ -51,10 +56,11 @@ class ASH_EXPORT LaserPointerPoints {
|
| private:
|
| friend class LaserPointerPointsTestApi;
|
|
|
| - void ClearOldPoints();
|
| -
|
| base::TimeDelta life_duration_;
|
| std::deque<LaserPoint> points_;
|
| + // The latest time of the collection of points. This gets updated when new
|
| + // points are added or when MoveForwardInTime is called.
|
| + base::Time collection_latest_time_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(LaserPointerPoints);
|
| };
|
|
|