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 #ifndef UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ | 5 #ifndef UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ |
6 #define UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ | 6 #define UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; } | 39 void set_now_for_test(base::TimeTicks now) { now_for_test_ = now; } |
40 | 40 |
41 bool HasObserver(const UserActivityObserver* observer) const; | 41 bool HasObserver(const UserActivityObserver* observer) const; |
42 void AddObserver(UserActivityObserver* observer); | 42 void AddObserver(UserActivityObserver* observer); |
43 void RemoveObserver(UserActivityObserver* observer); | 43 void RemoveObserver(UserActivityObserver* observer); |
44 | 44 |
45 // Called when displays are about to be turned on or off. | 45 // Called when displays are about to be turned on or off. |
46 void OnDisplayPowerChanging(); | 46 void OnDisplayPowerChanging(); |
47 | 47 |
| 48 // Handles reports of user activity originating from outside of |
| 49 // PlatformEventSource (e.g. the window server). |
| 50 void HandleExternalUserActivity(); |
| 51 |
48 // ui::PlatformEventObserver: | 52 // ui::PlatformEventObserver: |
49 void WillProcessEvent(const PlatformEvent& platform_event) override {} | 53 void WillProcessEvent(const PlatformEvent& platform_event) override {} |
50 void DidProcessEvent(const PlatformEvent& platform_event) override; | 54 void DidProcessEvent(const PlatformEvent& platform_event) override; |
51 | 55 |
52 private: | 56 private: |
53 friend class UserActivityDetectorTest; | 57 friend class UserActivityDetectorTest; |
54 | 58 |
55 // Returns |now_for_test_| if set or base::TimeTicks::Now() otherwise. | 59 // Returns |now_for_test_| if set or base::TimeTicks::Now() otherwise. |
56 base::TimeTicks GetCurrentTime() const; | 60 base::TimeTicks GetCurrentTime() const; |
57 | 61 |
(...skipping 24 matching lines...) Expand all Loading... |
82 // is to avoid reporting mouse events that occur when displays are turned | 86 // is to avoid reporting mouse events that occur when displays are turned |
83 // on or off as user activity. | 87 // on or off as user activity. |
84 base::TimeTicks honor_mouse_events_time_; | 88 base::TimeTicks honor_mouse_events_time_; |
85 | 89 |
86 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); | 90 DISALLOW_COPY_AND_ASSIGN(UserActivityDetector); |
87 }; | 91 }; |
88 | 92 |
89 } // namespace ui | 93 } // namespace ui |
90 | 94 |
91 #endif // UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ | 95 #endif // UI_BASE_USER_ACTIVITY_USER_ACTIVITY_DETECTOR_H_ |
OLD | NEW |