Index: ui/base/user_activity/user_activity_detector.h |
diff --git a/ui/base/user_activity/user_activity_detector.h b/ui/base/user_activity/user_activity_detector.h |
index 498485879bce7ac68332f521841ee0e0b3c27011..45e67eaf2162c7e6b8e0bcb77c6469591b397270 100644 |
--- a/ui/base/user_activity/user_activity_detector.h |
+++ b/ui/base/user_activity/user_activity_detector.h |
@@ -10,14 +10,15 @@ |
#include "base/observer_list.h" |
#include "base/time/time.h" |
#include "ui/base/ui_base_export.h" |
-#include "ui/events/event_handler.h" |
+#include "ui/events/event.h" |
+#include "ui/events/platform/platform_event_observer.h" |
namespace ui { |
class UserActivityObserver; |
// Watches for input events and notifies observers that the user is active. |
-class UI_BASE_EXPORT UserActivityDetector : public ui::EventHandler { |
+class UI_BASE_EXPORT UserActivityDetector : public ui::PlatformEventObserver { |
public: |
// Minimum amount of time between notifications to observers. |
static const int kNotifyIntervalMs; |
@@ -43,17 +44,19 @@ class UI_BASE_EXPORT UserActivityDetector : public ui::EventHandler { |
// Called when displays are about to be turned on or off. |
void OnDisplayPowerChanging(); |
- // ui::EventHandler implementation. |
- void OnKeyEvent(ui::KeyEvent* event) override; |
- void OnMouseEvent(ui::MouseEvent* event) override; |
- void OnScrollEvent(ui::ScrollEvent* event) override; |
- void OnTouchEvent(ui::TouchEvent* event) override; |
- void OnGestureEvent(ui::GestureEvent* event) override; |
+ // ui::PlatformEventObserver: |
+ void WillProcessEvent(const PlatformEvent& platform_event) override; |
+ void DidProcessEvent(const PlatformEvent& platform_event) override {} |
private: |
+ friend class UserActivityDetectorTest; |
+ |
// Returns |now_for_test_| if set or base::TimeTicks::Now() otherwise. |
base::TimeTicks GetCurrentTime() const; |
+ // Processes the event after it has been converted from a PlatformEvent. |
+ void ProcessReceivedEvent(const ui::Event* event); |
+ |
// Updates |last_activity_time_|. Additionally notifies observers and |
// updates |last_observer_notification_time_| if enough time has passed |
// since the last notification. |