Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / chromeos / dbus / dbus_thread_manager.cc
blob3f552706d30c24d3c714fdbe87442c698b5ace74
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
3 // found in the LICENSE file.
5 #include "chromeos/dbus/dbus_thread_manager.h"
7 #include "base/command_line.h"
8 #include "base/sys_info.h"
9 #include "base/threading/thread.h"
10 #include "chromeos/chromeos_switches.h"
11 #include "chromeos/dbus/amplifier_client.h"
12 #include "chromeos/dbus/ap_manager_client.h"
13 #include "chromeos/dbus/audio_dsp_client.h"
14 #include "chromeos/dbus/bluetooth_adapter_client.h"
15 #include "chromeos/dbus/bluetooth_agent_manager_client.h"
16 #include "chromeos/dbus/bluetooth_device_client.h"
17 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h"
18 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
19 #include "chromeos/dbus/bluetooth_gatt_manager_client.h"
20 #include "chromeos/dbus/bluetooth_gatt_service_client.h"
21 #include "chromeos/dbus/bluetooth_input_client.h"
22 #include "chromeos/dbus/bluetooth_le_advertising_manager_client.h"
23 #include "chromeos/dbus/bluetooth_media_client.h"
24 #include "chromeos/dbus/bluetooth_media_transport_client.h"
25 #include "chromeos/dbus/bluetooth_profile_manager_client.h"
26 #include "chromeos/dbus/cras_audio_client.h"
27 #include "chromeos/dbus/cros_disks_client.h"
28 #include "chromeos/dbus/cryptohome_client.h"
29 #include "chromeos/dbus/dbus_client.h"
30 #include "chromeos/dbus/debug_daemon_client.h"
31 #include "chromeos/dbus/easy_unlock_client.h"
32 #include "chromeos/dbus/gsm_sms_client.h"
33 #include "chromeos/dbus/image_burner_client.h"
34 #include "chromeos/dbus/introspectable_client.h"
35 #include "chromeos/dbus/leadership_daemon_manager_client.h"
36 #include "chromeos/dbus/lorgnette_manager_client.h"
37 #include "chromeos/dbus/metronome_client.h"
38 #include "chromeos/dbus/modem_messaging_client.h"
39 #include "chromeos/dbus/nfc_adapter_client.h"
40 #include "chromeos/dbus/nfc_device_client.h"
41 #include "chromeos/dbus/nfc_manager_client.h"
42 #include "chromeos/dbus/nfc_record_client.h"
43 #include "chromeos/dbus/nfc_tag_client.h"
44 #include "chromeos/dbus/peer_daemon_manager_client.h"
45 #include "chromeos/dbus/permission_broker_client.h"
46 #include "chromeos/dbus/power_manager_client.h"
47 #include "chromeos/dbus/privet_daemon_manager_client.h"
48 #include "chromeos/dbus/session_manager_client.h"
49 #include "chromeos/dbus/shill_device_client.h"
50 #include "chromeos/dbus/shill_ipconfig_client.h"
51 #include "chromeos/dbus/shill_manager_client.h"
52 #include "chromeos/dbus/shill_profile_client.h"
53 #include "chromeos/dbus/shill_service_client.h"
54 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
55 #include "chromeos/dbus/sms_client.h"
56 #include "chromeos/dbus/system_clock_client.h"
57 #include "chromeos/dbus/update_engine_client.h"
58 #include "dbus/bus.h"
59 #include "dbus/dbus_statistics.h"
61 namespace chromeos {
63 static DBusThreadManager* g_dbus_thread_manager = NULL;
64 static bool g_using_dbus_thread_manager_for_testing = false;
66 DBusThreadManager::DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle)
67 : client_bundle_(client_bundle.Pass()) {
68 dbus::statistics::Initialize();
70 if (client_bundle_->IsUsingAnyRealClient()) {
71 // At least one real DBusClient is used.
72 // Create the D-Bus thread.
73 base::Thread::Options thread_options;
74 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
75 dbus_thread_.reset(new base::Thread("D-Bus thread"));
76 dbus_thread_->StartWithOptions(thread_options);
78 // Create the connection to the system bus.
79 dbus::Bus::Options system_bus_options;
80 system_bus_options.bus_type = dbus::Bus::SYSTEM;
81 system_bus_options.connection_type = dbus::Bus::PRIVATE;
82 system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
83 system_bus_ = new dbus::Bus(system_bus_options);
87 DBusThreadManager::~DBusThreadManager() {
88 // Delete all D-Bus clients before shutting down the system bus.
89 client_bundle_.reset();
91 // Shut down the bus. During the browser shutdown, it's ok to shut down
92 // the bus synchronously.
93 if (system_bus_.get())
94 system_bus_->ShutdownOnDBusThreadAndBlock();
96 // Stop the D-Bus thread.
97 if (dbus_thread_)
98 dbus_thread_->Stop();
100 dbus::statistics::Shutdown();
102 if (!g_dbus_thread_manager)
103 return; // Called form Shutdown() or local test instance.
105 // There should never be both a global instance and a local instance.
106 CHECK(this == g_dbus_thread_manager);
107 if (g_using_dbus_thread_manager_for_testing) {
108 g_dbus_thread_manager = NULL;
109 g_using_dbus_thread_manager_for_testing = false;
110 VLOG(1) << "DBusThreadManager destroyed";
111 } else {
112 LOG(FATAL) << "~DBusThreadManager() called outside of Shutdown()";
116 dbus::Bus* DBusThreadManager::GetSystemBus() {
117 return system_bus_.get();
120 AmplifierClient* DBusThreadManager::GetAmplifierClient() {
121 return client_bundle_->amplifier_client();
124 ApManagerClient* DBusThreadManager::GetApManagerClient() {
125 return client_bundle_->ap_manager_client();
128 AudioDspClient* DBusThreadManager::GetAudioDspClient() {
129 return client_bundle_->audio_dsp_client();
132 BluetoothAdapterClient* DBusThreadManager::GetBluetoothAdapterClient() {
133 return client_bundle_->bluetooth_adapter_client();
136 BluetoothLEAdvertisingManagerClient*
137 DBusThreadManager::GetBluetoothLEAdvertisingManagerClient() {
138 return client_bundle_->bluetooth_le_advertising_manager_client();
141 BluetoothAgentManagerClient*
142 DBusThreadManager::GetBluetoothAgentManagerClient() {
143 return client_bundle_->bluetooth_agent_manager_client();
146 BluetoothDeviceClient* DBusThreadManager::GetBluetoothDeviceClient() {
147 return client_bundle_->bluetooth_device_client();
150 BluetoothGattCharacteristicClient*
151 DBusThreadManager::GetBluetoothGattCharacteristicClient() {
152 return client_bundle_->bluetooth_gatt_characteristic_client();
155 BluetoothGattDescriptorClient*
156 DBusThreadManager::GetBluetoothGattDescriptorClient() {
157 return client_bundle_->bluetooth_gatt_descriptor_client();
160 BluetoothGattManagerClient*
161 DBusThreadManager::GetBluetoothGattManagerClient() {
162 return client_bundle_->bluetooth_gatt_manager_client();
165 BluetoothGattServiceClient*
166 DBusThreadManager::GetBluetoothGattServiceClient() {
167 return client_bundle_->bluetooth_gatt_service_client();
170 BluetoothInputClient* DBusThreadManager::GetBluetoothInputClient() {
171 return client_bundle_->bluetooth_input_client();
174 BluetoothMediaClient* DBusThreadManager::GetBluetoothMediaClient() {
175 return client_bundle_->bluetooth_media_client();
178 BluetoothMediaTransportClient*
179 DBusThreadManager::GetBluetoothMediaTransportClient() {
180 return client_bundle_->bluetooth_media_transport_client();
183 BluetoothProfileManagerClient*
184 DBusThreadManager::GetBluetoothProfileManagerClient() {
185 return client_bundle_->bluetooth_profile_manager_client();
188 CrasAudioClient* DBusThreadManager::GetCrasAudioClient() {
189 return client_bundle_->cras_audio_client();
192 CrosDisksClient* DBusThreadManager::GetCrosDisksClient() {
193 return client_bundle_->cros_disks_client();
196 CryptohomeClient* DBusThreadManager::GetCryptohomeClient() {
197 return client_bundle_->cryptohome_client();
200 DebugDaemonClient* DBusThreadManager::GetDebugDaemonClient() {
201 return client_bundle_->debug_daemon_client();
204 EasyUnlockClient* DBusThreadManager::GetEasyUnlockClient() {
205 return client_bundle_->easy_unlock_client();
208 LeadershipDaemonManagerClient*
209 DBusThreadManager::GetLeadershipDaemonManagerClient() {
210 return client_bundle_->leadership_daemon_manager_client();
213 LorgnetteManagerClient*
214 DBusThreadManager::GetLorgnetteManagerClient() {
215 return client_bundle_->lorgnette_manager_client();
218 MetronomeClient* DBusThreadManager::GetMetronomeClient() {
219 return client_bundle_->metronome_client();
222 ShillDeviceClient*
223 DBusThreadManager::GetShillDeviceClient() {
224 return client_bundle_->shill_device_client();
227 ShillIPConfigClient*
228 DBusThreadManager::GetShillIPConfigClient() {
229 return client_bundle_->shill_ipconfig_client();
232 ShillManagerClient*
233 DBusThreadManager::GetShillManagerClient() {
234 return client_bundle_->shill_manager_client();
237 ShillServiceClient*
238 DBusThreadManager::GetShillServiceClient() {
239 return client_bundle_->shill_service_client();
242 ShillProfileClient*
243 DBusThreadManager::GetShillProfileClient() {
244 return client_bundle_->shill_profile_client();
247 ShillThirdPartyVpnDriverClient*
248 DBusThreadManager::GetShillThirdPartyVpnDriverClient() {
249 return client_bundle_->shill_third_party_vpn_driver_client();
252 GsmSMSClient* DBusThreadManager::GetGsmSMSClient() {
253 return client_bundle_->gsm_sms_client();
256 ImageBurnerClient* DBusThreadManager::GetImageBurnerClient() {
257 return client_bundle_->image_burner_client();
260 IntrospectableClient* DBusThreadManager::GetIntrospectableClient() {
261 return client_bundle_->introspectable_client();
264 ModemMessagingClient* DBusThreadManager::GetModemMessagingClient() {
265 return client_bundle_->modem_messaging_client();
268 NfcAdapterClient* DBusThreadManager::GetNfcAdapterClient() {
269 return client_bundle_->nfc_adapter_client();
272 NfcDeviceClient* DBusThreadManager::GetNfcDeviceClient() {
273 return client_bundle_->nfc_device_client();
276 NfcManagerClient* DBusThreadManager::GetNfcManagerClient() {
277 return client_bundle_->nfc_manager_client();
280 NfcRecordClient* DBusThreadManager::GetNfcRecordClient() {
281 return client_bundle_->nfc_record_client();
284 NfcTagClient* DBusThreadManager::GetNfcTagClient() {
285 return client_bundle_->nfc_tag_client();
288 PeerDaemonManagerClient* DBusThreadManager::GetPeerDaemonManagerClient() {
289 return client_bundle_->peer_daemon_manager_client();
292 PermissionBrokerClient* DBusThreadManager::GetPermissionBrokerClient() {
293 return client_bundle_->permission_broker_client();
296 PowerManagerClient* DBusThreadManager::GetPowerManagerClient() {
297 return client_bundle_->power_manager_client();
300 PrivetDaemonManagerClient* DBusThreadManager::GetPrivetDaemonManagerClient() {
301 return client_bundle_->privet_daemon_manager_client();
304 SessionManagerClient* DBusThreadManager::GetSessionManagerClient() {
305 return client_bundle_->session_manager_client();
308 SMSClient* DBusThreadManager::GetSMSClient() {
309 return client_bundle_->sms_client();
312 SystemClockClient* DBusThreadManager::GetSystemClockClient() {
313 return client_bundle_->system_clock_client();
316 UpdateEngineClient* DBusThreadManager::GetUpdateEngineClient() {
317 return client_bundle_->update_engine_client();
320 void DBusThreadManager::InitializeClients() {
321 GetAmplifierClient()->Init(GetSystemBus());
322 GetApManagerClient()->Init(GetSystemBus());
323 GetAudioDspClient()->Init(GetSystemBus());
324 GetBluetoothAdapterClient()->Init(GetSystemBus());
325 GetBluetoothAgentManagerClient()->Init(GetSystemBus());
326 GetBluetoothDeviceClient()->Init(GetSystemBus());
327 GetBluetoothGattCharacteristicClient()->Init(GetSystemBus());
328 GetBluetoothGattDescriptorClient()->Init(GetSystemBus());
329 GetBluetoothGattManagerClient()->Init(GetSystemBus());
330 GetBluetoothGattServiceClient()->Init(GetSystemBus());
331 GetBluetoothInputClient()->Init(GetSystemBus());
332 GetBluetoothMediaClient()->Init(GetSystemBus());
333 GetBluetoothMediaTransportClient()->Init(GetSystemBus());
334 GetBluetoothProfileManagerClient()->Init(GetSystemBus());
335 GetCrasAudioClient()->Init(GetSystemBus());
336 GetCrosDisksClient()->Init(GetSystemBus());
337 GetCryptohomeClient()->Init(GetSystemBus());
338 GetDebugDaemonClient()->Init(GetSystemBus());
339 GetEasyUnlockClient()->Init(GetSystemBus());
340 GetGsmSMSClient()->Init(GetSystemBus());
341 GetImageBurnerClient()->Init(GetSystemBus());
342 GetIntrospectableClient()->Init(GetSystemBus());
343 GetLeadershipDaemonManagerClient()->Init(GetSystemBus());
344 GetLorgnetteManagerClient()->Init(GetSystemBus());
345 GetMetronomeClient()->Init(GetSystemBus());
346 GetModemMessagingClient()->Init(GetSystemBus());
347 GetPermissionBrokerClient()->Init(GetSystemBus());
348 GetPeerDaemonManagerClient()->Init(GetSystemBus());
349 GetPrivetDaemonManagerClient()->Init(GetSystemBus());
350 GetPowerManagerClient()->Init(GetSystemBus());
351 GetSessionManagerClient()->Init(GetSystemBus());
352 GetShillDeviceClient()->Init(GetSystemBus());
353 GetShillIPConfigClient()->Init(GetSystemBus());
354 GetShillManagerClient()->Init(GetSystemBus());
355 GetShillServiceClient()->Init(GetSystemBus());
356 GetShillProfileClient()->Init(GetSystemBus());
357 GetShillThirdPartyVpnDriverClient()->Init(GetSystemBus());
358 GetSMSClient()->Init(GetSystemBus());
359 GetSystemClockClient()->Init(GetSystemBus());
360 GetUpdateEngineClient()->Init(GetSystemBus());
362 // Initialize the NFC clients in the correct order. The order of
363 // initialization matters due to dependencies that exist between the
364 // client objects.
365 GetNfcManagerClient()->Init(GetSystemBus());
366 GetNfcAdapterClient()->Init(GetSystemBus());
367 GetNfcDeviceClient()->Init(GetSystemBus());
368 GetNfcTagClient()->Init(GetSystemBus());
369 GetNfcRecordClient()->Init(GetSystemBus());
371 // This must be called after the list of clients so they've each had a
372 // chance to register with their object g_dbus_thread_managers.
373 if (GetSystemBus())
374 GetSystemBus()->GetManagedObjects();
376 client_bundle_->SetupDefaultEnvironment();
379 bool DBusThreadManager::IsUsingStub(DBusClientBundle::DBusClientType client) {
380 return client_bundle_->IsUsingStub(client);
383 // static
384 void DBusThreadManager::Initialize() {
385 // If we initialize DBusThreadManager twice we may also be shutting it down
386 // early; do not allow that.
387 if (g_using_dbus_thread_manager_for_testing)
388 return;
390 CHECK(!g_dbus_thread_manager);
391 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() ||
392 base::CommandLine::ForCurrentProcess()->HasSwitch(
393 chromeos::switches::kDbusStub);
394 bool force_unstub_clients = base::CommandLine::ForCurrentProcess()->HasSwitch(
395 chromeos::switches::kDbusUnstubClients);
396 // Determine whether we use stub or real client implementations.
397 if (force_unstub_clients) {
398 InitializeWithPartialStub(
399 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
400 chromeos::switches::kDbusUnstubClients));
401 } else if (use_dbus_stub) {
402 InitializeWithStubs();
403 } else {
404 InitializeWithRealClients();
408 // static
409 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() {
410 if (!g_using_dbus_thread_manager_for_testing) {
411 g_using_dbus_thread_manager_for_testing = true;
412 InitializeWithStubs();
415 return make_scoped_ptr(new DBusThreadManagerSetter());
418 // static
419 void DBusThreadManager::CreateGlobalInstance(
420 DBusClientBundle::DBusClientTypeMask unstub_client_mask) {
421 CHECK(!g_dbus_thread_manager);
422 g_dbus_thread_manager = new DBusThreadManager(
423 make_scoped_ptr(new DBusClientBundle(unstub_client_mask)));
424 g_dbus_thread_manager->InitializeClients();
427 // static
428 void DBusThreadManager::InitializeWithRealClients() {
429 CreateGlobalInstance(~static_cast<DBusClientBundle::DBusClientTypeMask>(0));
430 VLOG(1) << "DBusThreadManager initialized for Chrome OS";
433 // static
434 void DBusThreadManager::InitializeWithStubs() {
435 CreateGlobalInstance(0 /* unstub_client_mask */);
436 VLOG(1) << "DBusThreadManager created for testing";
439 // static
440 void DBusThreadManager::InitializeWithPartialStub(
441 const std::string& unstub_clients) {
442 DBusClientBundle::DBusClientTypeMask unstub_client_mask =
443 DBusClientBundle::ParseUnstubList(unstub_clients);
444 // We should have something parsed correctly here.
445 LOG_IF(FATAL, unstub_client_mask == 0)
446 << "Switch values for --" << chromeos::switches::kDbusUnstubClients
447 << " cannot be parsed: " << unstub_clients;
448 VLOG(1) << "DBusThreadManager initialized for mixed runtime environment";
449 CreateGlobalInstance(unstub_client_mask);
452 // static
453 bool DBusThreadManager::IsInitialized() {
454 return g_dbus_thread_manager != NULL;
457 // static
458 void DBusThreadManager::Shutdown() {
459 // Ensure that we only shutdown DBusThreadManager once.
460 CHECK(g_dbus_thread_manager);
461 DBusThreadManager* dbus_thread_manager = g_dbus_thread_manager;
462 g_dbus_thread_manager = NULL;
463 g_using_dbus_thread_manager_for_testing = false;
464 delete dbus_thread_manager;
465 VLOG(1) << "DBusThreadManager Shutdown completed";
468 // static
469 DBusThreadManager* DBusThreadManager::Get() {
470 CHECK(g_dbus_thread_manager)
471 << "DBusThreadManager::Get() called before Initialize()";
472 return g_dbus_thread_manager;
475 DBusThreadManagerSetter::DBusThreadManagerSetter() {
478 DBusThreadManagerSetter::~DBusThreadManagerSetter() {
481 void DBusThreadManagerSetter::SetAmplifierClient(
482 scoped_ptr<AmplifierClient> client) {
483 DBusThreadManager::Get()->client_bundle_->amplifier_client_ = client.Pass();
486 void DBusThreadManagerSetter::SetAudioDspClient(
487 scoped_ptr<AudioDspClient> client) {
488 DBusThreadManager::Get()->client_bundle_->audio_dsp_client_ = client.Pass();
491 void DBusThreadManagerSetter::SetBluetoothAdapterClient(
492 scoped_ptr<BluetoothAdapterClient> client) {
493 DBusThreadManager::Get()->client_bundle_->bluetooth_adapter_client_ =
494 client.Pass();
497 void DBusThreadManagerSetter::SetBluetoothLEAdvertisingManagerClient(
498 scoped_ptr<BluetoothLEAdvertisingManagerClient> client) {
499 DBusThreadManager::Get()->client_bundle_->
500 bluetooth_le_advertising_manager_client_ = client.Pass();
503 void DBusThreadManagerSetter::SetBluetoothAgentManagerClient(
504 scoped_ptr<BluetoothAgentManagerClient> client) {
505 DBusThreadManager::Get()->client_bundle_->bluetooth_agent_manager_client_ =
506 client.Pass();
509 void DBusThreadManagerSetter::SetBluetoothDeviceClient(
510 scoped_ptr<BluetoothDeviceClient> client) {
511 DBusThreadManager::Get()->client_bundle_->bluetooth_device_client_ =
512 client.Pass();
515 void DBusThreadManagerSetter::SetBluetoothGattCharacteristicClient(
516 scoped_ptr<BluetoothGattCharacteristicClient> client) {
517 DBusThreadManager::Get()->client_bundle_->
518 bluetooth_gatt_characteristic_client_ = client.Pass();
521 void DBusThreadManagerSetter::SetBluetoothGattDescriptorClient(
522 scoped_ptr<BluetoothGattDescriptorClient> client) {
523 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_descriptor_client_ =
524 client.Pass();
527 void DBusThreadManagerSetter::SetBluetoothGattManagerClient(
528 scoped_ptr<BluetoothGattManagerClient> client) {
529 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_manager_client_ =
530 client.Pass();
533 void DBusThreadManagerSetter::SetBluetoothGattServiceClient(
534 scoped_ptr<BluetoothGattServiceClient> client) {
535 DBusThreadManager::Get()->client_bundle_->bluetooth_gatt_service_client_ =
536 client.Pass();
539 void DBusThreadManagerSetter::SetBluetoothInputClient(
540 scoped_ptr<BluetoothInputClient> client) {
541 DBusThreadManager::Get()->client_bundle_->bluetooth_input_client_ =
542 client.Pass();
545 void DBusThreadManagerSetter::SetBluetoothMediaClient(
546 scoped_ptr<BluetoothMediaClient> client) {
547 DBusThreadManager::Get()->client_bundle_->bluetooth_media_client_ =
548 client.Pass();
551 void DBusThreadManagerSetter::SetBluetoothMediaTransportClient(
552 scoped_ptr<BluetoothMediaTransportClient> client) {
553 DBusThreadManager::Get()->client_bundle_->bluetooth_media_transport_client_ =
554 client.Pass();
557 void DBusThreadManagerSetter::SetBluetoothProfileManagerClient(
558 scoped_ptr<BluetoothProfileManagerClient> client) {
559 DBusThreadManager::Get()->client_bundle_->bluetooth_profile_manager_client_ =
560 client.Pass();
563 void DBusThreadManagerSetter::SetCrasAudioClient(
564 scoped_ptr<CrasAudioClient> client) {
565 DBusThreadManager::Get()->client_bundle_->cras_audio_client_ = client.Pass();
568 void DBusThreadManagerSetter::SetCrosDisksClient(
569 scoped_ptr<CrosDisksClient> client) {
570 DBusThreadManager::Get()->client_bundle_->cros_disks_client_ = client.Pass();
573 void DBusThreadManagerSetter::SetCryptohomeClient(
574 scoped_ptr<CryptohomeClient> client) {
575 DBusThreadManager::Get()->client_bundle_->cryptohome_client_ = client.Pass();
578 void DBusThreadManagerSetter::SetDebugDaemonClient(
579 scoped_ptr<DebugDaemonClient> client) {
580 DBusThreadManager::Get()->client_bundle_->debug_daemon_client_ =
581 client.Pass();
584 void DBusThreadManagerSetter::SetEasyUnlockClient(
585 scoped_ptr<EasyUnlockClient> client) {
586 DBusThreadManager::Get()->client_bundle_->easy_unlock_client_ = client.Pass();
589 void DBusThreadManagerSetter::SetLeadershipDaemonManagerClient(
590 scoped_ptr<LeadershipDaemonManagerClient> client) {
591 DBusThreadManager::Get()->client_bundle_->leadership_daemon_manager_client_ =
592 client.Pass();
595 void DBusThreadManagerSetter::SetLorgnetteManagerClient(
596 scoped_ptr<LorgnetteManagerClient> client) {
597 DBusThreadManager::Get()->client_bundle_->lorgnette_manager_client_ =
598 client.Pass();
601 void DBusThreadManagerSetter::SetMetronomeClient(
602 scoped_ptr<MetronomeClient> client) {
603 DBusThreadManager::Get()->client_bundle_->metronome_client_ = client.Pass();
606 void DBusThreadManagerSetter::SetShillDeviceClient(
607 scoped_ptr<ShillDeviceClient> client) {
608 DBusThreadManager::Get()->client_bundle_->shill_device_client_ =
609 client.Pass();
612 void DBusThreadManagerSetter::SetShillIPConfigClient(
613 scoped_ptr<ShillIPConfigClient> client) {
614 DBusThreadManager::Get()->client_bundle_->shill_ipconfig_client_ =
615 client.Pass();
618 void DBusThreadManagerSetter::SetShillManagerClient(
619 scoped_ptr<ShillManagerClient> client) {
620 DBusThreadManager::Get()->client_bundle_->shill_manager_client_ =
621 client.Pass();
624 void DBusThreadManagerSetter::SetShillServiceClient(
625 scoped_ptr<ShillServiceClient> client) {
626 DBusThreadManager::Get()->client_bundle_->shill_service_client_ =
627 client.Pass();
630 void DBusThreadManagerSetter::SetShillProfileClient(
631 scoped_ptr<ShillProfileClient> client) {
632 DBusThreadManager::Get()->client_bundle_->shill_profile_client_ =
633 client.Pass();
636 void DBusThreadManagerSetter::SetShillThirdPartyVpnDriverClient(
637 scoped_ptr<ShillThirdPartyVpnDriverClient> client) {
638 DBusThreadManager::Get()
639 ->client_bundle_->shill_third_party_vpn_driver_client_ = client.Pass();
642 void DBusThreadManagerSetter::SetGsmSMSClient(
643 scoped_ptr<GsmSMSClient> client) {
644 DBusThreadManager::Get()->client_bundle_->gsm_sms_client_ = client.Pass();
647 void DBusThreadManagerSetter::SetImageBurnerClient(
648 scoped_ptr<ImageBurnerClient> client) {
649 DBusThreadManager::Get()->client_bundle_->image_burner_client_ =
650 client.Pass();
653 void DBusThreadManagerSetter::SetIntrospectableClient(
654 scoped_ptr<IntrospectableClient> client) {
655 DBusThreadManager::Get()->client_bundle_->introspectable_client_ =
656 client.Pass();
659 void DBusThreadManagerSetter::SetModemMessagingClient(
660 scoped_ptr<ModemMessagingClient> client) {
661 DBusThreadManager::Get()->client_bundle_->modem_messaging_client_ =
662 client.Pass();
665 void DBusThreadManagerSetter::SetNfcAdapterClient(
666 scoped_ptr<NfcAdapterClient> client) {
667 DBusThreadManager::Get()->client_bundle_->nfc_adapter_client_ = client.Pass();
670 void DBusThreadManagerSetter::SetNfcDeviceClient(
671 scoped_ptr<NfcDeviceClient> client) {
672 DBusThreadManager::Get()->client_bundle_->nfc_device_client_ = client.Pass();
675 void DBusThreadManagerSetter::SetNfcManagerClient(
676 scoped_ptr<NfcManagerClient> client) {
677 DBusThreadManager::Get()->client_bundle_->nfc_manager_client_ = client.Pass();
680 void DBusThreadManagerSetter::SetNfcRecordClient(
681 scoped_ptr<NfcRecordClient> client) {
682 DBusThreadManager::Get()->client_bundle_->nfc_record_client_ = client.Pass();
685 void DBusThreadManagerSetter::SetNfcTagClient(
686 scoped_ptr<NfcTagClient> client) {
687 DBusThreadManager::Get()->client_bundle_->nfc_tag_client_ = client.Pass();
690 void DBusThreadManagerSetter::SetPeerDaemonManagerClient(
691 scoped_ptr<PeerDaemonManagerClient> client) {
692 DBusThreadManager::Get()->client_bundle_->peer_daemon_manager_client_ =
693 client.Pass();
696 void DBusThreadManagerSetter::SetPermissionBrokerClient(
697 scoped_ptr<PermissionBrokerClient> client) {
698 DBusThreadManager::Get()->client_bundle_->permission_broker_client_ =
699 client.Pass();
702 void DBusThreadManagerSetter::SetPrivetDaemonManagerClient(
703 scoped_ptr<PrivetDaemonManagerClient> client) {
704 DBusThreadManager::Get()->client_bundle_->privet_daemon_manager_client_ =
705 client.Pass();
708 void DBusThreadManagerSetter::SetPowerManagerClient(
709 scoped_ptr<PowerManagerClient> client) {
710 DBusThreadManager::Get()->client_bundle_->power_manager_client_ =
711 client.Pass();
714 void DBusThreadManagerSetter::SetSessionManagerClient(
715 scoped_ptr<SessionManagerClient> client) {
716 DBusThreadManager::Get()->client_bundle_->session_manager_client_ =
717 client.Pass();
720 void DBusThreadManagerSetter::SetSMSClient(scoped_ptr<SMSClient> client) {
721 DBusThreadManager::Get()->client_bundle_->sms_client_ = client.Pass();
724 void DBusThreadManagerSetter::SetSystemClockClient(
725 scoped_ptr<SystemClockClient> client) {
726 DBusThreadManager::Get()->client_bundle_->system_clock_client_ =
727 client.Pass();
730 void DBusThreadManagerSetter::SetUpdateEngineClient(
731 scoped_ptr<UpdateEngineClient> client) {
732 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
733 client.Pass();
736 } // namespace chromeos