| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium OS 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 POWER_DAEMON_H_ | 5 #ifndef POWER_DAEMON_H_ |
| 6 #define POWER_DAEMON_H_ | 6 #define POWER_DAEMON_H_ |
| 7 | 7 |
| 8 #include <dbus/dbus-glib-lowlevel.h> | 8 #include <dbus/dbus-glib-lowlevel.h> |
| 9 #include <gtest/gtest_prod.h> // for FRIEND_TEST | 9 #include <gtest/gtest_prod.h> // for FRIEND_TEST |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "power_manager/inotify.h" | 22 #include "power_manager/inotify.h" |
| 23 #include "power_manager/power_prefs.h" | 23 #include "power_manager/power_prefs.h" |
| 24 #include "power_manager/screen_locker.h" | 24 #include "power_manager/screen_locker.h" |
| 25 #include "power_manager/suspender.h" | 25 #include "power_manager/suspender.h" |
| 26 #include "power_manager/video_detector.h" | 26 #include "power_manager/video_detector.h" |
| 27 #include "power_manager/xidle.h" | 27 #include "power_manager/xidle.h" |
| 28 #include "power_manager/xidle_monitor.h" | 28 #include "power_manager/xidle_monitor.h" |
| 29 | 29 |
| 30 namespace power_manager { | 30 namespace power_manager { |
| 31 | 31 |
| 32 class MonitorReconfigureMain; |
| 32 class PowerButtonHandler; | 33 class PowerButtonHandler; |
| 33 | 34 |
| 34 class Daemon : public XIdleMonitor { | 35 class Daemon : public XIdleMonitor { |
| 35 public: | 36 public: |
| 36 Daemon(BacklightController* ctl, PowerPrefs* prefs, | 37 Daemon(BacklightController* ctl, PowerPrefs* prefs, |
| 37 MetricsLibraryInterface* metrics_lib, | 38 MetricsLibraryInterface* metrics_lib, |
| 38 VideoDetectorInterface* video_detector, | 39 VideoDetectorInterface* video_detector, |
| 40 MonitorReconfigureMain* monitor_reconfigure, |
| 39 const FilePath& run_dir); | 41 const FilePath& run_dir); |
| 40 ~Daemon(); | 42 ~Daemon(); |
| 41 | 43 |
| 42 ScreenLocker* locker() { return &locker_; } | 44 ScreenLocker* locker() { return &locker_; } |
| 43 BacklightController* backlight_controller() { return backlight_controller_; } | 45 BacklightController* backlight_controller() { return backlight_controller_; } |
| 44 | 46 |
| 45 const std::string& current_user() const { return current_user_; } | 47 const std::string& current_user() const { return current_user_; } |
| 46 | 48 |
| 47 void Init(); | 49 void Init(); |
| 48 void Run(); | 50 void Run(); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 int max); | 226 int max); |
| 225 | 227 |
| 226 // Called by dbus handler when resume signal is received | 228 // Called by dbus handler when resume signal is received |
| 227 void HandleResume(); | 229 void HandleResume(); |
| 228 | 230 |
| 229 BacklightController* backlight_controller_; | 231 BacklightController* backlight_controller_; |
| 230 PowerPrefs* prefs_; | 232 PowerPrefs* prefs_; |
| 231 MetricsLibraryInterface* metrics_lib_; | 233 MetricsLibraryInterface* metrics_lib_; |
| 232 VideoDetectorInterface* video_detector_; | 234 VideoDetectorInterface* video_detector_; |
| 233 XIdle idle_; | 235 XIdle idle_; |
| 236 MonitorReconfigureMain* monitor_reconfigure_; |
| 234 double low_battery_suspend_percent_; | 237 double low_battery_suspend_percent_; |
| 235 bool clean_shutdown_initiated_; | 238 bool clean_shutdown_initiated_; |
| 236 bool low_battery_; | 239 bool low_battery_; |
| 237 int64 clean_shutdown_timeout_ms_; | 240 int64 clean_shutdown_timeout_ms_; |
| 238 int64 plugged_dim_ms_; | 241 int64 plugged_dim_ms_; |
| 239 int64 plugged_off_ms_; | 242 int64 plugged_off_ms_; |
| 240 int64 plugged_suspend_ms_; | 243 int64 plugged_suspend_ms_; |
| 241 int64 unplugged_dim_ms_; | 244 int64 unplugged_dim_ms_; |
| 242 int64 unplugged_off_ms_; | 245 int64 unplugged_off_ms_; |
| 243 int64 unplugged_suspend_ms_; | 246 int64 unplugged_suspend_ms_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 KeyCode key_f7_; | 287 KeyCode key_f7_; |
| 285 | 288 |
| 286 // User whose session is currently active, or empty if no session is | 289 // User whose session is currently active, or empty if no session is |
| 287 // active or we're in guest mode. | 290 // active or we're in guest mode. |
| 288 std::string current_user_; | 291 std::string current_user_; |
| 289 }; | 292 }; |
| 290 | 293 |
| 291 } // namespace power_manager | 294 } // namespace power_manager |
| 292 | 295 |
| 293 #endif // POWER_DAEMON_H_ | 296 #endif // POWER_DAEMON_H_ |
| OLD | NEW |