OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef ASH_WM_USER_ACTIVITY_DETECTOR_H_ | 5 #ifndef ASH_WM_USER_ACTIVITY_DETECTOR_H_ |
6 #define ASH_WM_USER_ACTIVITY_DETECTOR_H_ | 6 #define ASH_WM_USER_ACTIVITY_DETECTOR_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // aura::EventFilter implementation. | 34 // aura::EventFilter implementation. |
35 virtual bool PreHandleKeyEvent( | 35 virtual bool PreHandleKeyEvent( |
36 aura::Window* target, | 36 aura::Window* target, |
37 ui::KeyEvent* event) OVERRIDE; | 37 ui::KeyEvent* event) OVERRIDE; |
38 virtual bool PreHandleMouseEvent( | 38 virtual bool PreHandleMouseEvent( |
39 aura::Window* target, | 39 aura::Window* target, |
40 ui::MouseEvent* event) OVERRIDE; | 40 ui::MouseEvent* event) OVERRIDE; |
41 virtual ui::TouchStatus PreHandleTouchEvent( | 41 virtual ui::TouchStatus PreHandleTouchEvent( |
42 aura::Window* target, | 42 aura::Window* target, |
43 ui::TouchEventImpl* event) OVERRIDE; | 43 ui::TouchEvent* event) OVERRIDE; |
44 virtual ui::GestureStatus PreHandleGestureEvent( | 44 virtual ui::GestureStatus PreHandleGestureEvent( |
45 aura::Window* target, | 45 aura::Window* target, |
46 ui::GestureEventImpl* event) OVERRIDE; | 46 ui::GestureEventImpl* event) OVERRIDE; |
47 | 47 |
48 private: | 48 private: |
49 // Notifies observers if enough time has passed since the last notification. | 49 // Notifies observers if enough time has passed since the last notification. |
50 void MaybeNotify(); | 50 void MaybeNotify(); |
51 | 51 |
52 ObserverList<UserActivityObserver> observers_; | 52 ObserverList<UserActivityObserver> observers_; |
53 | 53 |
54 // Last time at which we notified observers that the user was active. | 54 // Last time at which we notified observers that the user was active. |
55 base::TimeTicks last_observer_notification_time_; | 55 base::TimeTicks last_observer_notification_time_; |
56 | 56 |
57 // If set, used when the current time is needed. This can be set by tests to | 57 // If set, used when the current time is needed. This can be set by tests to |
58 // simulate the passage of time. | 58 // simulate the passage of time. |
59 base::TimeTicks now_for_test_; | 59 base::TimeTicks now_for_test_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); | 61 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace ash | 64 } // namespace ash |
65 | 65 |
66 #endif // ASH_WM_USER_ACTIVITY_DETECTOR_H_ | 66 #endif // ASH_WM_USER_ACTIVITY_DETECTOR_H_ |
OLD | NEW |