Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: ui/base/user_activity/user_activity_detector.h

Issue 1024583003: Fix for menus blocking user activity detection (Retry 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
« no previous file with comments | « extensions/shell/browser/shell_desktop_controller_aura.cc ('k') | ui/base/user_activity/user_activity_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698