Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / ash / system / chromeos / power / user_activity_notifier.h
1 // Copyright 2013 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
5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_USER_ACTIVITY_NOTIFIER_H_
6 #define ASH_SYSTEM_CHROMEOS_POWER_USER_ACTIVITY_NOTIFIER_H_
7
8 #include "ash/wm/user_activity_observer.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/time/time.h"
12
13 namespace ash {
14
15 class UserActivityDetector;
16
17 namespace internal {
18
19 // Notifies the power manager when the user is active.
20 class UserActivityNotifier : public UserActivityObserver {
21  public:
22   explicit UserActivityNotifier(UserActivityDetector* detector);
23   virtual ~UserActivityNotifier();
24
25   // UserActivityObserver implementation.
26   virtual void OnUserActivity(const ui::Event* event) OVERRIDE;
27
28  private:
29   UserActivityDetector* detector_;  // not owned
30
31   // Last time that the power manager was notified.
32   base::TimeTicks last_notify_time_;
33
34   DISALLOW_COPY_AND_ASSIGN(UserActivityNotifier);
35 };
36
37 }  // namespace internal
38 }  // namespace ash
39
40 #endif  // ASH_SYSTEM_CHROMEOS_POWER_USER_ACTIVITY_NOTIFIER_H_