| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ | 5 #ifndef UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ |
| 6 #define UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ | 6 #define UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "ui/base/user_activity/user_activity_observer.h" | 11 #include "ui/base/user_activity/user_activity_observer.h" |
| 12 #include "ui/chromeos/ui_chromeos_export.h" | 12 #include "ui/chromeos/ui_chromeos_export.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 class UserActivityDetector; | 16 class UserActivityDetector; |
| 17 | 17 |
| 18 // Notifies the power manager when the user is active. | 18 // Notifies the power manager when the user is active. |
| 19 class UI_CHROMEOS_EXPORT UserActivityPowerManagerNotifier | 19 class UI_CHROMEOS_EXPORT UserActivityPowerManagerNotifier |
| 20 : public UserActivityObserver { | 20 : public UserActivityObserver { |
| 21 public: | 21 public: |
| 22 explicit UserActivityPowerManagerNotifier(UserActivityDetector* detector); | 22 explicit UserActivityPowerManagerNotifier(UserActivityDetector* detector); |
| 23 virtual ~UserActivityPowerManagerNotifier(); | 23 ~UserActivityPowerManagerNotifier() override; |
| 24 | 24 |
| 25 // UserActivityObserver implementation. | 25 // UserActivityObserver implementation. |
| 26 virtual void OnUserActivity(const Event* event) override; | 26 void OnUserActivity(const Event* event) override; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 UserActivityDetector* detector_; // not owned | 29 UserActivityDetector* detector_; // not owned |
| 30 | 30 |
| 31 // Last time that the power manager was notified. | 31 // Last time that the power manager was notified. |
| 32 base::TimeTicks last_notify_time_; | 32 base::TimeTicks last_notify_time_; |
| 33 | 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(UserActivityPowerManagerNotifier); | 34 DISALLOW_COPY_AND_ASSIGN(UserActivityPowerManagerNotifier); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace ui | 37 } // namespace ui |
| 38 | 38 |
| 39 #endif // UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ | 39 #endif // UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ |
| OLD | NEW |