| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #include "chromeos/dbus/dbus_thread_manager.h" | 5 #include "chromeos/dbus/dbus_thread_manager.h" |
| 6 | 6 |
| 7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
| 11 #include "chromeos/dbus/bluetooth_adapter_client.h" | 11 #include "chromeos/dbus/bluetooth_adapter_client.h" |
| 12 #include "chromeos/dbus/bluetooth_device_client.h" | 12 #include "chromeos/dbus/bluetooth_device_client.h" |
| 13 #include "chromeos/dbus/bluetooth_input_client.h" | 13 #include "chromeos/dbus/bluetooth_input_client.h" |
| 14 #include "chromeos/dbus/bluetooth_manager_client.h" | 14 #include "chromeos/dbus/bluetooth_manager_client.h" |
| 15 #include "chromeos/dbus/bluetooth_node_client.h" | 15 #include "chromeos/dbus/bluetooth_node_client.h" |
| 16 #include "chromeos/dbus/cashew_client.h" | 16 #include "chromeos/dbus/cashew_client.h" |
| 17 #include "chromeos/dbus/cros_disks_client.h" | 17 #include "chromeos/dbus/cros_disks_client.h" |
| 18 #include "chromeos/dbus/cryptohome_client.h" | 18 #include "chromeos/dbus/cryptohome_client.h" |
| 19 #include "chromeos/dbus/dbus_client_implementation_type.h" | 19 #include "chromeos/dbus/dbus_client_implementation_type.h" |
| 20 #include "chromeos/dbus/debug_daemon_client.h" | 20 #include "chromeos/dbus/debug_daemon_client.h" |
| 21 #include "chromeos/dbus/flimflam_device_client.h" | 21 #include "chromeos/dbus/flimflam_device_client.h" |
| 22 #include "chromeos/dbus/flimflam_ipconfig_client.h" | 22 #include "chromeos/dbus/flimflam_ipconfig_client.h" |
| 23 #include "chromeos/dbus/flimflam_manager_client.h" | 23 #include "chromeos/dbus/flimflam_manager_client.h" |
| 24 #include "chromeos/dbus/flimflam_network_client.h" | 24 #include "chromeos/dbus/flimflam_network_client.h" |
| 25 #include "chromeos/dbus/flimflam_profile_client.h" | 25 #include "chromeos/dbus/flimflam_profile_client.h" |
| 26 #include "chromeos/dbus/flimflam_service_client.h" | 26 #include "chromeos/dbus/flimflam_service_client.h" |
| 27 #include "chromeos/dbus/gsm_sms_client.h" | 27 #include "chromeos/dbus/gsm_sms_client.h" |
| 28 #include "chromeos/dbus/image_burner_client.h" | 28 #include "chromeos/dbus/image_burner_client.h" |
| 29 #include "chromeos/dbus/introspectable_client.h" | 29 #include "chromeos/dbus/introspectable_client.h" |
| 30 #include "chromeos/dbus/modem_messaging_client.h" |
| 30 #include "chromeos/dbus/power_manager_client.h" | 31 #include "chromeos/dbus/power_manager_client.h" |
| 31 #include "chromeos/dbus/session_manager_client.h" | 32 #include "chromeos/dbus/session_manager_client.h" |
| 33 #include "chromeos/dbus/sms_client.h" |
| 32 #include "chromeos/dbus/speech_synthesizer_client.h" | 34 #include "chromeos/dbus/speech_synthesizer_client.h" |
| 33 #include "chromeos/dbus/update_engine_client.h" | 35 #include "chromeos/dbus/update_engine_client.h" |
| 34 #include "chromeos/dbus/ibus/ibus_client.h" | 36 #include "chromeos/dbus/ibus/ibus_client.h" |
| 35 #include "chromeos/dbus/ibus/ibus_input_context_client.h" | 37 #include "chromeos/dbus/ibus/ibus_input_context_client.h" |
| 36 #include "dbus/bus.h" | 38 #include "dbus/bus.h" |
| 37 | 39 |
| 38 namespace chromeos { | 40 namespace chromeos { |
| 39 | 41 |
| 40 static DBusThreadManager* g_dbus_thread_manager = NULL; | 42 static DBusThreadManager* g_dbus_thread_manager = NULL; |
| 41 | 43 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 FlimflamManagerClient::Create(client_type, system_bus_.get())); | 99 FlimflamManagerClient::Create(client_type, system_bus_.get())); |
| 98 // Create the Flimflam Network client. | 100 // Create the Flimflam Network client. |
| 99 flimflam_network_client_.reset( | 101 flimflam_network_client_.reset( |
| 100 FlimflamNetworkClient::Create(client_type, system_bus_.get())); | 102 FlimflamNetworkClient::Create(client_type, system_bus_.get())); |
| 101 // Create the Flimflam Profile client. | 103 // Create the Flimflam Profile client. |
| 102 flimflam_profile_client_.reset( | 104 flimflam_profile_client_.reset( |
| 103 FlimflamProfileClient::Create(client_type, system_bus_.get())); | 105 FlimflamProfileClient::Create(client_type, system_bus_.get())); |
| 104 // Create the Flimflam Service client. | 106 // Create the Flimflam Service client. |
| 105 flimflam_service_client_.reset( | 107 flimflam_service_client_.reset( |
| 106 FlimflamServiceClient::Create(client_type, system_bus_.get())); | 108 FlimflamServiceClient::Create(client_type, system_bus_.get())); |
| 107 // Create the SMS cilent. | 109 // Create the Gsm SMS client. |
| 108 gsm_sms_client_.reset( | 110 gsm_sms_client_.reset( |
| 109 GsmSMSClient::Create(client_type, system_bus_.get())); | 111 GsmSMSClient::Create(client_type, system_bus_.get())); |
| 110 // Create the image burner client. | 112 // Create the image burner client. |
| 111 image_burner_client_.reset(ImageBurnerClient::Create(client_type, | 113 image_burner_client_.reset(ImageBurnerClient::Create(client_type, |
| 112 system_bus_.get())); | 114 system_bus_.get())); |
| 113 // Create the introspectable object client. | 115 // Create the introspectable object client. |
| 114 introspectable_client_.reset( | 116 introspectable_client_.reset( |
| 115 IntrospectableClient::Create(client_type, system_bus_.get())); | 117 IntrospectableClient::Create(client_type, system_bus_.get())); |
| 118 // Create the ModemMessaging client. |
| 119 modem_messaging_client_.reset( |
| 120 ModemMessagingClient::Create(client_type, system_bus_.get())); |
| 116 // Create the power manager client. | 121 // Create the power manager client. |
| 117 power_manager_client_.reset( | 122 power_manager_client_.reset( |
| 118 PowerManagerClient::Create(client_type_maybe_stub, system_bus_.get())); | 123 PowerManagerClient::Create(client_type_maybe_stub, system_bus_.get())); |
| 119 // Create the session manager client. | 124 // Create the session manager client. |
| 120 session_manager_client_.reset( | 125 session_manager_client_.reset( |
| 121 SessionManagerClient::Create(client_type, system_bus_.get())); | 126 SessionManagerClient::Create(client_type, system_bus_.get())); |
| 127 // Create the SMS client. |
| 128 sms_client_.reset( |
| 129 SMSClient::Create(client_type, system_bus_.get())); |
| 122 // Create the speech synthesizer client. | 130 // Create the speech synthesizer client. |
| 123 speech_synthesizer_client_.reset( | 131 speech_synthesizer_client_.reset( |
| 124 SpeechSynthesizerClient::Create(client_type, system_bus_.get())); | 132 SpeechSynthesizerClient::Create(client_type, system_bus_.get())); |
| 125 // Create the update engine client. | 133 // Create the update engine client. |
| 126 update_engine_client_.reset( | 134 update_engine_client_.reset( |
| 127 UpdateEngineClient::Create(client_type, system_bus_.get())); | 135 UpdateEngineClient::Create(client_type, system_bus_.get())); |
| 128 } | 136 } |
| 129 | 137 |
| 130 virtual ~DBusThreadManagerImpl() { | 138 virtual ~DBusThreadManagerImpl() { |
| 131 // Shut down the bus. During the browser shutdown, it's ok to shut down | 139 // Shut down the bus. During the browser shutdown, it's ok to shut down |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 virtual ImageBurnerClient* GetImageBurnerClient() OVERRIDE { | 266 virtual ImageBurnerClient* GetImageBurnerClient() OVERRIDE { |
| 259 return image_burner_client_.get(); | 267 return image_burner_client_.get(); |
| 260 } | 268 } |
| 261 | 269 |
| 262 // DBusThreadManager override. | 270 // DBusThreadManager override. |
| 263 virtual IntrospectableClient* GetIntrospectableClient() OVERRIDE { | 271 virtual IntrospectableClient* GetIntrospectableClient() OVERRIDE { |
| 264 return introspectable_client_.get(); | 272 return introspectable_client_.get(); |
| 265 } | 273 } |
| 266 | 274 |
| 267 // DBusThreadManager override. | 275 // DBusThreadManager override. |
| 276 virtual ModemMessagingClient* GetModemMessagingClient() OVERRIDE { |
| 277 return modem_messaging_client_.get(); |
| 278 } |
| 279 |
| 280 // DBusThreadManager override. |
| 268 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE { | 281 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE { |
| 269 return power_manager_client_.get(); | 282 return power_manager_client_.get(); |
| 270 } | 283 } |
| 271 | 284 |
| 272 // DBusThreadManager override. | 285 // DBusThreadManager override. |
| 273 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE { | 286 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE { |
| 274 return session_manager_client_.get(); | 287 return session_manager_client_.get(); |
| 275 } | 288 } |
| 276 | 289 |
| 277 // DBusThreadManager override. | 290 // DBusThreadManager override. |
| 291 virtual SMSClient* GetSMSClient() OVERRIDE { |
| 292 return sms_client_.get(); |
| 293 } |
| 294 |
| 295 // DBusThreadManager override. |
| 278 virtual SpeechSynthesizerClient* GetSpeechSynthesizerClient() OVERRIDE { | 296 virtual SpeechSynthesizerClient* GetSpeechSynthesizerClient() OVERRIDE { |
| 279 return speech_synthesizer_client_.get(); | 297 return speech_synthesizer_client_.get(); |
| 280 } | 298 } |
| 281 | 299 |
| 282 // DBusThreadManager override. | 300 // DBusThreadManager override. |
| 283 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE { | 301 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE { |
| 284 return update_engine_client_.get(); | 302 return update_engine_client_.get(); |
| 285 } | 303 } |
| 286 | 304 |
| 287 // DBusThreadManager override. | 305 // DBusThreadManager override. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 308 scoped_ptr<DebugDaemonClient> debugdaemon_client_; | 326 scoped_ptr<DebugDaemonClient> debugdaemon_client_; |
| 309 scoped_ptr<FlimflamDeviceClient> flimflam_device_client_; | 327 scoped_ptr<FlimflamDeviceClient> flimflam_device_client_; |
| 310 scoped_ptr<FlimflamIPConfigClient> flimflam_ipconfig_client_; | 328 scoped_ptr<FlimflamIPConfigClient> flimflam_ipconfig_client_; |
| 311 scoped_ptr<FlimflamManagerClient> flimflam_manager_client_; | 329 scoped_ptr<FlimflamManagerClient> flimflam_manager_client_; |
| 312 scoped_ptr<FlimflamNetworkClient> flimflam_network_client_; | 330 scoped_ptr<FlimflamNetworkClient> flimflam_network_client_; |
| 313 scoped_ptr<FlimflamProfileClient> flimflam_profile_client_; | 331 scoped_ptr<FlimflamProfileClient> flimflam_profile_client_; |
| 314 scoped_ptr<FlimflamServiceClient> flimflam_service_client_; | 332 scoped_ptr<FlimflamServiceClient> flimflam_service_client_; |
| 315 scoped_ptr<GsmSMSClient> gsm_sms_client_; | 333 scoped_ptr<GsmSMSClient> gsm_sms_client_; |
| 316 scoped_ptr<ImageBurnerClient> image_burner_client_; | 334 scoped_ptr<ImageBurnerClient> image_burner_client_; |
| 317 scoped_ptr<IntrospectableClient> introspectable_client_; | 335 scoped_ptr<IntrospectableClient> introspectable_client_; |
| 336 scoped_ptr<ModemMessagingClient> modem_messaging_client_; |
| 318 scoped_ptr<PowerManagerClient> power_manager_client_; | 337 scoped_ptr<PowerManagerClient> power_manager_client_; |
| 319 scoped_ptr<SessionManagerClient> session_manager_client_; | 338 scoped_ptr<SessionManagerClient> session_manager_client_; |
| 339 scoped_ptr<SMSClient> sms_client_; |
| 320 scoped_ptr<SpeechSynthesizerClient> speech_synthesizer_client_; | 340 scoped_ptr<SpeechSynthesizerClient> speech_synthesizer_client_; |
| 321 scoped_ptr<UpdateEngineClient> update_engine_client_; | 341 scoped_ptr<UpdateEngineClient> update_engine_client_; |
| 322 scoped_ptr<IBusClient> ibus_client_; | 342 scoped_ptr<IBusClient> ibus_client_; |
| 323 scoped_ptr<IBusInputContextClient> ibus_input_context_client_; | 343 scoped_ptr<IBusInputContextClient> ibus_input_context_client_; |
| 324 | 344 |
| 325 std::string ibus_address_; | 345 std::string ibus_address_; |
| 326 }; | 346 }; |
| 327 | 347 |
| 328 // static | 348 // static |
| 329 void DBusThreadManager::Initialize() { | 349 void DBusThreadManager::Initialize() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 401 } |
| 382 | 402 |
| 383 // static | 403 // static |
| 384 DBusThreadManager* DBusThreadManager::Get() { | 404 DBusThreadManager* DBusThreadManager::Get() { |
| 385 CHECK(g_dbus_thread_manager) | 405 CHECK(g_dbus_thread_manager) |
| 386 << "DBusThreadManager::Get() called before Initialize()"; | 406 << "DBusThreadManager::Get() called before Initialize()"; |
| 387 return g_dbus_thread_manager; | 407 return g_dbus_thread_manager; |
| 388 } | 408 } |
| 389 | 409 |
| 390 } // namespace chromeos | 410 } // namespace chromeos |
| OLD | NEW |