OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 "window_manager/motion_event_coalescer.h" | 5 #include "window_manager/motion_event_coalescer.h" |
6 | 6 |
7 #include "chromeos/obsolete_logging.h" | 7 #include "chromeos/obsolete_logging.h" |
8 | 8 |
9 namespace chromeos { | 9 namespace window_manager { |
| 10 |
| 11 using chromeos::Closure; |
10 | 12 |
11 MotionEventCoalescer::MotionEventCoalescer(Closure* cb, int timeout_ms) | 13 MotionEventCoalescer::MotionEventCoalescer(Closure* cb, int timeout_ms) |
12 : timer_id_(0), | 14 : timer_id_(0), |
13 timeout_ms_(timeout_ms), | 15 timeout_ms_(timeout_ms), |
14 have_queued_position_(false), | 16 have_queued_position_(false), |
15 x_(0), | 17 x_(0), |
16 y_(0), | 18 y_(0), |
17 cb_(cb) { | 19 cb_(cb) { |
18 CHECK(cb); | 20 CHECK(cb); |
19 CHECK_GT(timeout_ms, 0); | 21 CHECK_GT(timeout_ms, 0); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 67 } |
66 | 68 |
67 gboolean MotionEventCoalescer::HandleTimer() { | 69 gboolean MotionEventCoalescer::HandleTimer() { |
68 if (have_queued_position_) { | 70 if (have_queued_position_) { |
69 cb_->Run(); | 71 cb_->Run(); |
70 have_queued_position_ = false; | 72 have_queued_position_ = false; |
71 } | 73 } |
72 return TRUE; | 74 return TRUE; |
73 } | 75 } |
74 | 76 |
75 } // namespace chromeos | 77 } // namespace window_manager |
OLD | NEW |