OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 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 CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | |
6 #define CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
Mattias Nissler (ping if slow)
2013/02/05 13:16:18
needed?
Daniel Erat
2013/02/05 14:05:58
Shouldn't be. Thanks, removed.
| |
10 #include "base/prefs/public/pref_service_base.h" | |
11 #include "base/time.h" | |
Mattias Nissler (ping if slow)
2013/02/05 13:16:18
needed?
Daniel Erat
2013/02/05 14:05:58
Removed.
| |
12 #include "chromeos/chromeos_export.h" | |
13 #include "chromeos/dbus/power_manager/policy.pb.h" | |
14 | |
15 namespace chromeos { | |
16 | |
17 class PowerManagerClient; | |
18 | |
19 class CHROMEOS_EXPORT PowerPolicyController { | |
20 public: | |
21 // Note: Do not change these values; they are used by preferences. | |
22 enum Action { | |
23 ACTION_SUSPEND = 0, | |
24 ACTION_STOP_SESSION = 1, | |
25 ACTION_SHUT_DOWN = 2, | |
26 ACTION_DO_NOTHING = 3, | |
27 }; | |
28 | |
29 explicit PowerPolicyController(PowerManagerClient* client); | |
30 ~PowerPolicyController(); | |
31 | |
32 // Sends an updated policy to the power manager based on the current | |
33 // values of the passed-in prefs. | |
34 void UpdatePolicyFromPrefs( | |
35 const PrefServiceBase::Preference& ac_screen_dim_delay_ms_pref, | |
36 const PrefServiceBase::Preference& ac_screen_off_delay_ms_pref, | |
37 const PrefServiceBase::Preference& ac_screen_lock_delay_ms_pref, | |
38 const PrefServiceBase::Preference& ac_idle_delay_ms_pref, | |
39 const PrefServiceBase::Preference& battery_screen_dim_delay_ms_pref, | |
40 const PrefServiceBase::Preference& battery_screen_off_delay_ms_pref, | |
41 const PrefServiceBase::Preference& battery_screen_lock_delay_ms_pref, | |
42 const PrefServiceBase::Preference& battery_idle_delay_ms_pref, | |
43 const PrefServiceBase::Preference& idle_action_pref, | |
44 const PrefServiceBase::Preference& lid_closed_action_pref, | |
45 const PrefServiceBase::Preference& use_audio_activity_pref, | |
46 const PrefServiceBase::Preference& use_video_activity_pref, | |
47 const PrefServiceBase::Preference& presentation_idle_delay_factor_pref); | |
48 | |
49 private: | |
50 PowerManagerClient* client_; // not owned | |
51 | |
52 // Policy specified by the prefs that were last passed to | |
53 // UpdatePolicyFromPrefs(). | |
54 power_manager::PowerManagementPolicy prefs_policy_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); | |
57 }; | |
58 | |
59 } // namespace chromeos | |
60 | |
61 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | |
OLD | NEW |