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

Unified Diff: ash/laser/laser_pointer_points.h

Issue 2362063002: cros: Laser pointer fades out on release, do not cover palette. (Closed)
Patch Set: Created 4 years, 3 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
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..db4ba2e50803fa1f1d20460c7b74940938867cbe 100644
--- a/ash/laser/laser_pointer_points.h
+++ b/ash/laser/laser_pointer_points.h
@@ -33,6 +33,11 @@ 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
jdufault 2016/09/23 23:59:19 Fix formatting
sammiequon 2016/09/26 19:30:38 Done.
+ // old.
+ void MoveForwardInTime();
+ void MoveForwardInTime(const base::Time& new_latest_time);
// Removes all points.
void Clear();
// Gets the bounding box of the points.
@@ -41,6 +46,10 @@ class ASH_EXPORT LaserPointerPoints {
LaserPoint GetOldest() const;
// Returns the newest point in the collection.
LaserPoint GetNewest() const;
+ // Returns the latest time of the collection.
+ base::Time GetCollectionLatestTime() const;
+ // Returns the earliest time of the collection.
+ base::Time GetCollectionEarliestTime() const;
// Returns the number of points in the collection.
int GetNumberOfPoints() const;
// Whether there are any points or not.
@@ -55,6 +64,9 @@ class ASH_EXPORT LaserPointerPoints {
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);
};

Powered by Google App Engine
This is Rietveld 408576698