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.
5 #ifndef UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_
6 #define UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/time/time.h"
11 #include "ui/chromeos/ui_chromeos_export.h"
12 #include "ui/wm/core/user_activity_observer.h"
15 class UserActivityDetector
;
20 // Notifies the power manager when the user is active.
21 class UI_CHROMEOS_EXPORT UserActivityPowerManagerNotifier
22 : public ::wm::UserActivityObserver
{
24 explicit UserActivityPowerManagerNotifier(
25 ::wm::UserActivityDetector
* detector
);
26 virtual ~UserActivityPowerManagerNotifier();
28 // UserActivityObserver implementation.
29 virtual void OnUserActivity(const Event
* event
) override
;
32 ::wm::UserActivityDetector
* detector_
; // not owned
34 // Last time that the power manager was notified.
35 base::TimeTicks last_notify_time_
;
37 DISALLOW_COPY_AND_ASSIGN(UserActivityPowerManagerNotifier
);
42 #endif // UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_