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/base/user_activity/user_activity_observer.h"
12 #include "ui/chromeos/ui_chromeos_export.h"
16 class UserActivityDetector
;
18 // Notifies the power manager when the user is active.
19 class UI_CHROMEOS_EXPORT UserActivityPowerManagerNotifier
20 : public UserActivityObserver
{
22 explicit UserActivityPowerManagerNotifier(UserActivityDetector
* detector
);
23 ~UserActivityPowerManagerNotifier() override
;
25 // UserActivityObserver implementation.
26 void OnUserActivity(const Event
* event
) override
;
29 UserActivityDetector
* detector_
; // not owned
31 // Last time that the power manager was notified.
32 base::TimeTicks last_notify_time_
;
34 DISALLOW_COPY_AND_ASSIGN(UserActivityPowerManagerNotifier
);
39 #endif // UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_