Chromium Code Reviews| Index: ash/common/system/chromeos/palette/tools/laser_pointer_points_test_api.cc |
| diff --git a/ash/common/system/chromeos/palette/tools/laser_pointer_points_test_api.cc b/ash/common/system/chromeos/palette/tools/laser_pointer_points_test_api.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d01af6cb2c62acdde5a536c0cdb905d92ca73803 |
| --- /dev/null |
| +++ b/ash/common/system/chromeos/palette/tools/laser_pointer_points_test_api.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2016 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. |
| + |
| +#include "ash/common/system/chromeos/palette/tools/laser_pointer_points_test_api.h" |
| + |
| +#include "ash/common/system/chromeos/palette/tools/laser_pointer_points.h" |
| + |
| +namespace ash { |
| + |
| +LaserPointerPointsTestApi::LaserPointerPointsTestApi( |
| + std::unique_ptr<LaserPointerPoints> instance) |
| + : new_point_time_(base::Time::Now()), instance_(std::move(instance)) {} |
| + |
| +LaserPointerPointsTestApi::~LaserPointerPointsTestApi() {} |
| + |
| +int LaserPointerPointsTestApi::GetNumberOfPoints() const { |
| + return instance_->GetNumberOfPoints(); |
| +} |
| + |
| +void LaserPointerPointsTestApi::MoveForwardInTime( |
| + const base::TimeDelta& delta) { |
| + for (LaserPointerPoints::LaserPoint& point : instance_->points_) |
| + point.creation_time -= delta; |
| + |
| + LaserPointerPoints::LaserPoint new_point; |
| + new_point.creation_time = new_point_time_; |
| + new_point.location = gfx::Point(); |
|
oshima
2016/08/24 23:01:03
you don't need this.
sammiequon
2016/08/25 17:59:04
Done.
|
| + instance_->points_.push_back(new_point); |
| + instance_->ClearOldPoints(); |
| +} |
| +} // namespace ash |