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