| 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/chromeos/ui_chromeos_export.h" | 11 #include "ui/chromeos/ui_chromeos_export.h" |
| 12 #include "ui/wm/core/user_activity_observer.h" | 12 #include "ui/wm/core/user_activity_observer.h" |
| 13 | 13 |
| 14 namespace wm { | 14 namespace wm { |
| 15 class UserActivityDetector; | 15 class UserActivityDetector; |
| 16 } // namespace wm | 16 } // namespace wm |
| 17 | 17 |
| 18 namespace ui { | 18 namespace ui { |
| 19 | 19 |
| 20 // Notifies the power manager when the user is active. | 20 // Notifies the power manager when the user is active. |
| 21 class UI_CHROMEOS_EXPORT UserActivityPowerManagerNotifier | 21 class UI_CHROMEOS_EXPORT UserActivityPowerManagerNotifier |
| 22 : public ::wm::UserActivityObserver { | 22 : public ::wm::UserActivityObserver { |
| 23 public: | 23 public: |
| 24 explicit UserActivityPowerManagerNotifier( | 24 explicit UserActivityPowerManagerNotifier( |
| 25 ::wm::UserActivityDetector* detector); | 25 ::wm::UserActivityDetector* detector); |
| 26 virtual ~UserActivityPowerManagerNotifier(); | 26 virtual ~UserActivityPowerManagerNotifier(); |
| 27 | 27 |
| 28 // UserActivityObserver implementation. | 28 // UserActivityObserver implementation. |
| 29 virtual void OnUserActivity(const Event* event) OVERRIDE; | 29 virtual void OnUserActivity(const Event* event) override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 ::wm::UserActivityDetector* detector_; // not owned | 32 ::wm::UserActivityDetector* detector_; // not owned |
| 33 | 33 |
| 34 // Last time that the power manager was notified. | 34 // Last time that the power manager was notified. |
| 35 base::TimeTicks last_notify_time_; | 35 base::TimeTicks last_notify_time_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(UserActivityPowerManagerNotifier); | 37 DISALLOW_COPY_AND_ASSIGN(UserActivityPowerManagerNotifier); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace ui | 40 } // namespace ui |
| 41 | 41 |
| 42 #endif // UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ | 42 #endif // UI_CHROMEOS_USER_ACTIVITY_POWER_MANAGER_NOTIFIER_H_ |
| OLD | NEW |