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

Unified Diff: ash/laser/laser_pointer_points_test_api.cc

Issue 2362063002: cros: Laser pointer fades out on release, do not cover palette. (Closed)
Patch Set: Nit. Created 4 years, 2 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 | « ash/laser/laser_pointer_points_test_api.h ('k') | ash/laser/laser_pointer_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/laser/laser_pointer_points_test_api.cc
diff --git a/ash/laser/laser_pointer_points_test_api.cc b/ash/laser/laser_pointer_points_test_api.cc
index 5180731128d1e4e18a4c0622ffcd3b7c241b252f..01d9d55b3c7fd442298b94d996e6db4112c2b0c9 100644
--- a/ash/laser/laser_pointer_points_test_api.cc
+++ b/ash/laser/laser_pointer_points_test_api.cc
@@ -4,13 +4,11 @@
#include "ash/laser/laser_pointer_points_test_api.h"
-#include "ash/laser/laser_pointer_points.h"
-
namespace ash {
LaserPointerPointsTestApi::LaserPointerPointsTestApi(
LaserPointerPoints* instance)
- : new_point_time_(base::Time::Now()), instance_(instance) {}
+ : instance_(instance) {}
LaserPointerPointsTestApi::~LaserPointerPointsTestApi() {}
@@ -20,12 +18,17 @@ int LaserPointerPointsTestApi::GetNumberOfPoints() const {
void LaserPointerPointsTestApi::MoveForwardInTime(
const base::TimeDelta& delta) {
- for (LaserPointerPoints::LaserPoint& point : instance_->points_)
- point.creation_time -= delta;
+ base::Time new_time = instance_->collection_latest_time_ + delta;
+ instance_->MoveForwardToTime(new_time);
LaserPointerPoints::LaserPoint new_point;
- new_point.creation_time = new_point_time_;
instance_->points_.push_back(new_point);
- instance_->ClearOldPoints();
}
+
+LaserPointerPoints::LaserPoint LaserPointerPointsTestApi::GetPointAtIndex(
+ int index) {
+ DCHECK(index >= 0 && index < GetNumberOfPoints());
+ return instance_->points_[index];
+}
+
} // namespace ash
« no previous file with comments | « ash/laser/laser_pointer_points_test_api.h ('k') | ash/laser/laser_pointer_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698