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

Side by Side Diff: ash/laser/laser_pointer_points.cc

Issue 2361563002: chromeos: Laser tool blocks events from propagating. (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 unified diff | Download patch
« no previous file with comments | « ash/laser/laser_pointer_points.h ('k') | ash/laser/laser_pointer_points_test_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/chromeos/palette/tools/laser_pointer_points.h" 5 #include "ash/laser/laser_pointer_points.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 namespace ash { 10 namespace ash {
11 11
12 LaserPointerPoints::LaserPointerPoints(base::TimeDelta life_duration) 12 LaserPointerPoints::LaserPointerPoints(base::TimeDelta life_duration)
13 : life_duration_(life_duration) {} 13 : life_duration_(life_duration) {}
14 14
15 LaserPointerPoints::~LaserPointerPoints() {} 15 LaserPointerPoints::~LaserPointerPoints() {}
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 void LaserPointerPoints::ClearOldPoints() { 65 void LaserPointerPoints::ClearOldPoints() {
66 DCHECK(!IsEmpty()); 66 DCHECK(!IsEmpty());
67 auto first_alive_point = 67 auto first_alive_point =
68 std::find_if(points_.begin(), points_.end(), [this](LaserPoint& p) { 68 std::find_if(points_.begin(), points_.end(), [this](LaserPoint& p) {
69 return GetNewest().creation_time - p.creation_time < life_duration_; 69 return GetNewest().creation_time - p.creation_time < life_duration_;
70 }); 70 });
71 points_.erase(points_.begin(), first_alive_point); 71 points_.erase(points_.begin(), first_alive_point);
72 } 72 }
73 73
74 } // namespace ash 74 } // namespace ash
OLDNEW
« no previous file with comments | « ash/laser/laser_pointer_points.h ('k') | ash/laser/laser_pointer_points_test_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698