Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chromeos/dbus/power_policy_controller.h

Issue 12186010: chromeos: Add power management policy prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass prefs directly to PowerPolicyController Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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"
10 #include "base/prefs/public/pref_service_base.h"
11 #include "base/time.h"
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698