OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ash/common/system/chromeos/palette/tools/laser_pointer_testapis.h" | |
6 | |
7 #include "ash/common/system/chromeos/palette/tools/laser_pointer_mode.h" | |
8 #include "ash/common/system/chromeos/palette/tools/laser_pointer_view.h" | |
9 | |
10 namespace ash { | |
11 | |
12 LaserPointerPointsTestApi::LaserPointerPointsTestApi( | |
13 std::unique_ptr<LaserPointerPoints> instance) | |
14 : instance_(std::move(instance)) {} | |
15 | |
16 LaserPointerPointsTestApi::~LaserPointerPointsTestApi() {} | |
17 | |
18 int LaserPointerPointsTestApi::get_number_of_points() const { | |
jdufault
2016/08/23 02:11:25
Keep method names the same: GetNumberOfPoints()
sammiequon
2016/08/23 19:30:02
Done.
| |
19 return instance_->GetNumberOfPoints(); | |
20 } | |
21 | |
22 void LaserPointerPointsTestApi::MoveForwardInTime(const base::TimeDelta& delta, | |
23 const base::Time& time, | |
24 const gfx::Point& location) { | |
25 for (LaserPointerPoints::LaserPoint& point : instance_->points_) | |
26 point.creation_time -= delta; | |
27 | |
28 LaserPointerPoints::LaserPoint new_point; | |
29 new_point.creation_time = time; | |
30 new_point.location = location; | |
31 instance_->points_.push_back(new_point); | |
32 instance_->ClearOldPoints(); | |
33 } | |
34 | |
35 LaserPointerModeTestApi::LaserPointerModeTestApi( | |
36 std::unique_ptr<LaserPointerMode> instance) | |
37 : instance_(std::move(instance)) {} | |
38 | |
39 LaserPointerModeTestApi::~LaserPointerModeTestApi() {} | |
40 | |
41 void LaserPointerModeTestApi::OnEnable() { | |
42 instance_->OnEnable(); | |
43 } | |
44 | |
45 void LaserPointerModeTestApi::OnDisable() { | |
46 instance_->OnDisable(); | |
47 } | |
48 | |
49 const LaserPointerPoints& LaserPointerModeTestApi::laser_points() { | |
50 return instance_->laser_pointer_view_->laser_points_; | |
51 } | |
52 | |
53 gfx::Point LaserPointerModeTestApi::current_mouse_location() { | |
54 return instance_->current_mouse_location_; | |
55 } | |
56 } // namespace ash | |
OLD | NEW |