| 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 24 matching lines...) Expand all Loading... |
| 35 // aura::EventFilter implementation. | 35 // aura::EventFilter implementation. |
| 36 virtual bool PreHandleKeyEvent( | 36 virtual bool PreHandleKeyEvent( |
| 37 aura::Window* target, | 37 aura::Window* target, |
| 38 ui::KeyEvent* event) OVERRIDE; | 38 ui::KeyEvent* event) OVERRIDE; |
| 39 virtual bool PreHandleMouseEvent( | 39 virtual bool PreHandleMouseEvent( |
| 40 aura::Window* target, | 40 aura::Window* target, |
| 41 ui::MouseEvent* event) OVERRIDE; | 41 ui::MouseEvent* event) OVERRIDE; |
| 42 virtual ui::TouchStatus PreHandleTouchEvent( | 42 virtual ui::TouchStatus PreHandleTouchEvent( |
| 43 aura::Window* target, | 43 aura::Window* target, |
| 44 ui::TouchEvent* event) OVERRIDE; | 44 ui::TouchEvent* event) OVERRIDE; |
| 45 virtual ui::GestureStatus PreHandleGestureEvent( | 45 virtual ui::EventResult PreHandleGestureEvent( |
| 46 aura::Window* target, | 46 aura::Window* target, |
| 47 ui::GestureEvent* event) OVERRIDE; | 47 ui::GestureEvent* event) OVERRIDE; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // Notifies observers if enough time has passed since the last notification. | 50 // Notifies observers if enough time has passed since the last notification. |
| 51 void MaybeNotify(); | 51 void MaybeNotify(); |
| 52 | 52 |
| 53 ObserverList<UserActivityObserver> observers_; | 53 ObserverList<UserActivityObserver> observers_; |
| 54 | 54 |
| 55 // Last time at which we notified observers that the user was active. | 55 // Last time at which we notified observers that the user was active. |
| 56 base::TimeTicks last_observer_notification_time_; | 56 base::TimeTicks last_observer_notification_time_; |
| 57 | 57 |
| 58 // If set, used when the current time is needed. This can be set by tests to | 58 // If set, used when the current time is needed. This can be set by tests to |
| 59 // simulate the passage of time. | 59 // simulate the passage of time. |
| 60 base::TimeTicks now_for_test_; | 60 base::TimeTicks now_for_test_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); | 62 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace ash | 65 } // namespace ash |
| 66 | 66 |
| 67 #endif // ASH_WM_USER_ACTIVITY_DETECTOR_H_ | 67 #endif // ASH_WM_USER_ACTIVITY_DETECTOR_H_ |
| OLD | NEW |