user_activity_observer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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
  3. // found in the LICENSE file.
  4. #ifndef UI_BASE_USER_ACTIVITY_USER_ACTIVITY_OBSERVER_H_
  5. #define UI_BASE_USER_ACTIVITY_USER_ACTIVITY_OBSERVER_H_
  6. #include "base/component_export.h"
  7. namespace ui {
  8. class Event;
  9. }
  10. namespace ui {
  11. // Interface for classes that want to be notified about user activity.
  12. // Implementations should register themselves with UserActivityDetector.
  13. class COMPONENT_EXPORT(UI_BASE) UserActivityObserver {
  14. public:
  15. UserActivityObserver(const UserActivityObserver&) = delete;
  16. UserActivityObserver& operator=(const UserActivityObserver&) = delete;
  17. // Invoked periodically while the user is active (i.e. generating input
  18. // events). |event| is the event that triggered the notification; it may
  19. // be NULL in some cases (e.g. testing or synthetic invocations).
  20. virtual void OnUserActivity(const ui::Event* event) = 0;
  21. protected:
  22. UserActivityObserver() {}
  23. virtual ~UserActivityObserver() {}
  24. };
  25. } // namespace ui
  26. #endif // UI_BASE_USER_ACTIVITY_USER_ACTIVITY_OBSERVER_H_