Chromium Code Reviews| Index: ash/common/system/chromeos/palette/tools/laser_pointer_points_testapi.cc |
| diff --git a/ash/common/system/chromeos/palette/tools/laser_pointer_points_testapi.cc b/ash/common/system/chromeos/palette/tools/laser_pointer_points_testapi.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..11eb3fcb750c2ff776818b2bb7b64a090f6751d9 |
| --- /dev/null |
| +++ b/ash/common/system/chromeos/palette/tools/laser_pointer_points_testapi.cc |
| @@ -0,0 +1,34 @@ |
| +// 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_testapi.h" |
| + |
| +#include "ash/common/system/chromeos/palette/tools/laser_pointer_points.h" |
| + |
| +namespace ash { |
| + |
| +LaserPointerPointsTestApi::LaserPointerPointsTestApi( |
| + std::unique_ptr<LaserPointerPoints> instance) |
| + : time_(base::Time::Now()), |
|
jdufault
2016/08/23 21:52:05
new_point_time_?
Add a comment to the member sayi
sammiequon
2016/08/24 00:04:05
Done.
|
| + location_(gfx::Point()), |
|
jdufault
2016/08/23 21:52:05
Remove location_ and use gfx::Point() directly
sammiequon
2016/08/24 00:04:05
Done.
|
| + 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 = time_; |
| + new_point.location = location_; |
| + instance_->points_.push_back(new_point); |
| + instance_->ClearOldPoints(); |
| +} |
| +} // namespace ash |