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

Unified Diff: chromeos/dbus/dbus_thread_manager.cc

Issue 12186010: chromeos: Add power management policy prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix observer registration and bool prefs 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/mock_dbus_thread_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/dbus_thread_manager.cc
diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc
index 0b0c5d1423247b536ac0ce837f7901b1d5b1d866..25e1fefc0949224574d49d2d8302285057929907 100644
--- a/chromeos/dbus/dbus_thread_manager.cc
+++ b/chromeos/dbus/dbus_thread_manager.cc
@@ -39,6 +39,7 @@
#include "chromeos/dbus/modem_messaging_client.h"
#include "chromeos/dbus/permission_broker_client.h"
#include "chromeos/dbus/power_manager_client.h"
+#include "chromeos/dbus/power_policy_controller.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/dbus/sms_client.h"
#include "chromeos/dbus/speech_synthesizer_client.h"
@@ -124,6 +125,11 @@ class DBusThreadManagerImpl : public DBusThreadManager {
SpeechSynthesizerClient::Create(client_type, system_bus_.get()));
update_engine_client_.reset(
UpdateEngineClient::Create(client_type, system_bus_.get()));
+
+ // PowerPolicyController is dependent on PowerManagerClient, so
+ // initialize it after the main list of clients.
+ power_policy_controller_.reset(
+ new PowerPolicyController(this, power_manager_client_.get()));
}
virtual ~DBusThreadManagerImpl() {
@@ -281,6 +287,10 @@ class DBusThreadManagerImpl : public DBusThreadManager {
return power_manager_client_.get();
}
+ virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE {
+ return power_policy_controller_.get();
+ }
+
virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE {
return session_manager_client_.get();
}
@@ -342,6 +352,10 @@ class DBusThreadManagerImpl : public DBusThreadManager {
return ibus_panel_service_.get();
}
+ // Note: Keep this before other members so they can call AddObserver() in
+ // their c'tors.
+ ObserverList<DBusThreadManagerObserver> observers_;
+
scoped_ptr<base::Thread> dbus_thread_;
scoped_refptr<dbus::Bus> system_bus_;
scoped_refptr<dbus::Bus> ibus_bus_;
@@ -375,10 +389,9 @@ class DBusThreadManagerImpl : public DBusThreadManager {
scoped_ptr<IBusEngineFactoryService> ibus_engine_factory_service_;
std::map<dbus::ObjectPath, IBusEngineService*> ibus_engine_services_;
scoped_ptr<IBusPanelService> ibus_panel_service_;
+ scoped_ptr<PowerPolicyController> power_policy_controller_;
std::string ibus_address_;
-
- ObserverList<DBusThreadManagerObserver> observers_;
};
// static
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/mock_dbus_thread_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698