OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.h" | 5 #include "ui/events/ozone/evdev/libgestures_glue/gesture_timer_provider.h" |
6 | 6 |
7 #include <gestures/gestures.h> | 7 #include <gestures/gestures.h> |
8 | 8 |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 timer_.Start(FROM_HERE, | 34 timer_.Start(FROM_HERE, |
35 base::TimeDelta::FromMicroseconds( | 35 base::TimeDelta::FromMicroseconds( |
36 next_delay * base::Time::kMicrosecondsPerSecond), | 36 next_delay * base::Time::kMicrosecondsPerSecond), |
37 this, | 37 this, |
38 &GesturesTimer::OnTimerExpired); | 38 &GesturesTimer::OnTimerExpired); |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 GesturesTimerCallback callback_ = nullptr; | 42 GesturesTimerCallback callback_ = nullptr; |
43 void* callback_data_ = nullptr; | 43 void* callback_data_ = nullptr; |
44 base::OneShotTimer<GesturesTimer> timer_; | 44 base::OneShotTimer timer_; |
45 }; | 45 }; |
46 | 46 |
47 namespace ui { | 47 namespace ui { |
48 | 48 |
49 namespace { | 49 namespace { |
50 | 50 |
51 GesturesTimer* GesturesTimerCreate(void* data) { return new GesturesTimer; } | 51 GesturesTimer* GesturesTimerCreate(void* data) { return new GesturesTimer; } |
52 | 52 |
53 void GesturesTimerSet(void* data, | 53 void GesturesTimerSet(void* data, |
54 GesturesTimer* timer, | 54 GesturesTimer* timer, |
(...skipping 16 matching lines...) Expand all Loading... |
71 PLOG(FATAL) << "clock_gettime"; | 71 PLOG(FATAL) << "clock_gettime"; |
72 | 72 |
73 return StimeFromTimespec(&ts); | 73 return StimeFromTimespec(&ts); |
74 } | 74 } |
75 | 75 |
76 const GesturesTimerProvider kGestureTimerProvider = { | 76 const GesturesTimerProvider kGestureTimerProvider = { |
77 GesturesTimerCreate, GesturesTimerSet, GesturesTimerCancel, | 77 GesturesTimerCreate, GesturesTimerSet, GesturesTimerCancel, |
78 GesturesTimerFree}; | 78 GesturesTimerFree}; |
79 | 79 |
80 } // namespace ui | 80 } // namespace ui |
OLD | NEW |