| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_client_bundle.h" | 5 #include "chromeos/dbus/dbus_client_bundle.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chromeos/dbus/fake_arc_obb_mounter_client.h" | 21 #include "chromeos/dbus/fake_arc_obb_mounter_client.h" |
| 22 #include "chromeos/dbus/fake_cras_audio_client.h" | 22 #include "chromeos/dbus/fake_cras_audio_client.h" |
| 23 #include "chromeos/dbus/fake_cryptohome_client.h" | 23 #include "chromeos/dbus/fake_cryptohome_client.h" |
| 24 #include "chromeos/dbus/fake_debug_daemon_client.h" | 24 #include "chromeos/dbus/fake_debug_daemon_client.h" |
| 25 #include "chromeos/dbus/fake_easy_unlock_client.h" | 25 #include "chromeos/dbus/fake_easy_unlock_client.h" |
| 26 #include "chromeos/dbus/fake_gsm_sms_client.h" | 26 #include "chromeos/dbus/fake_gsm_sms_client.h" |
| 27 #include "chromeos/dbus/fake_image_burner_client.h" | 27 #include "chromeos/dbus/fake_image_burner_client.h" |
| 28 #include "chromeos/dbus/fake_introspectable_client.h" | 28 #include "chromeos/dbus/fake_introspectable_client.h" |
| 29 #include "chromeos/dbus/fake_lorgnette_manager_client.h" | 29 #include "chromeos/dbus/fake_lorgnette_manager_client.h" |
| 30 #include "chromeos/dbus/fake_modem_messaging_client.h" | 30 #include "chromeos/dbus/fake_modem_messaging_client.h" |
| 31 #include "chromeos/dbus/fake_nfc_adapter_client.h" | |
| 32 #include "chromeos/dbus/fake_nfc_device_client.h" | |
| 33 #include "chromeos/dbus/fake_nfc_manager_client.h" | |
| 34 #include "chromeos/dbus/fake_nfc_record_client.h" | |
| 35 #include "chromeos/dbus/fake_nfc_tag_client.h" | |
| 36 #include "chromeos/dbus/fake_permission_broker_client.h" | 31 #include "chromeos/dbus/fake_permission_broker_client.h" |
| 37 #include "chromeos/dbus/fake_shill_device_client.h" | 32 #include "chromeos/dbus/fake_shill_device_client.h" |
| 38 #include "chromeos/dbus/fake_shill_ipconfig_client.h" | 33 #include "chromeos/dbus/fake_shill_ipconfig_client.h" |
| 39 #include "chromeos/dbus/fake_shill_manager_client.h" | 34 #include "chromeos/dbus/fake_shill_manager_client.h" |
| 40 #include "chromeos/dbus/fake_shill_profile_client.h" | 35 #include "chromeos/dbus/fake_shill_profile_client.h" |
| 41 #include "chromeos/dbus/fake_shill_service_client.h" | 36 #include "chromeos/dbus/fake_shill_service_client.h" |
| 42 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" | 37 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" |
| 43 #include "chromeos/dbus/fake_sms_client.h" | 38 #include "chromeos/dbus/fake_sms_client.h" |
| 44 #include "chromeos/dbus/fake_system_clock_client.h" | 39 #include "chromeos/dbus/fake_system_clock_client.h" |
| 45 #include "chromeos/dbus/gsm_sms_client.h" | 40 #include "chromeos/dbus/gsm_sms_client.h" |
| 46 #include "chromeos/dbus/image_burner_client.h" | 41 #include "chromeos/dbus/image_burner_client.h" |
| 47 #include "chromeos/dbus/introspectable_client.h" | 42 #include "chromeos/dbus/introspectable_client.h" |
| 48 #include "chromeos/dbus/lorgnette_manager_client.h" | 43 #include "chromeos/dbus/lorgnette_manager_client.h" |
| 49 #include "chromeos/dbus/modem_messaging_client.h" | 44 #include "chromeos/dbus/modem_messaging_client.h" |
| 50 #include "chromeos/dbus/nfc_adapter_client.h" | |
| 51 #include "chromeos/dbus/nfc_device_client.h" | |
| 52 #include "chromeos/dbus/nfc_manager_client.h" | |
| 53 #include "chromeos/dbus/nfc_record_client.h" | |
| 54 #include "chromeos/dbus/nfc_tag_client.h" | |
| 55 #include "chromeos/dbus/permission_broker_client.h" | 45 #include "chromeos/dbus/permission_broker_client.h" |
| 56 #include "chromeos/dbus/power_manager_client.h" | 46 #include "chromeos/dbus/power_manager_client.h" |
| 57 #include "chromeos/dbus/power_policy_controller.h" | 47 #include "chromeos/dbus/power_policy_controller.h" |
| 58 #include "chromeos/dbus/session_manager_client.h" | 48 #include "chromeos/dbus/session_manager_client.h" |
| 59 #include "chromeos/dbus/shill_device_client.h" | 49 #include "chromeos/dbus/shill_device_client.h" |
| 60 #include "chromeos/dbus/shill_ipconfig_client.h" | 50 #include "chromeos/dbus/shill_ipconfig_client.h" |
| 61 #include "chromeos/dbus/shill_manager_client.h" | 51 #include "chromeos/dbus/shill_manager_client.h" |
| 62 #include "chromeos/dbus/shill_profile_client.h" | 52 #include "chromeos/dbus/shill_profile_client.h" |
| 63 #include "chromeos/dbus/shill_service_client.h" | 53 #include "chromeos/dbus/shill_service_client.h" |
| 64 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h" | 54 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 80 { "cros_disks", DBusClientBundle::CROS_DISKS }, | 70 { "cros_disks", DBusClientBundle::CROS_DISKS }, |
| 81 { "cryptohome", DBusClientBundle::CRYPTOHOME }, | 71 { "cryptohome", DBusClientBundle::CRYPTOHOME }, |
| 82 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, | 72 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, |
| 83 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, | 73 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, |
| 84 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, | 74 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, |
| 85 { "shill", DBusClientBundle::SHILL }, | 75 { "shill", DBusClientBundle::SHILL }, |
| 86 { "gsm_sms", DBusClientBundle::GSM_SMS }, | 76 { "gsm_sms", DBusClientBundle::GSM_SMS }, |
| 87 { "image_burner", DBusClientBundle::IMAGE_BURNER }, | 77 { "image_burner", DBusClientBundle::IMAGE_BURNER }, |
| 88 { "introspectable", DBusClientBundle::INTROSPECTABLE }, | 78 { "introspectable", DBusClientBundle::INTROSPECTABLE }, |
| 89 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, | 79 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, |
| 90 { "nfc", DBusClientBundle::NFC }, | |
| 91 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, | 80 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, |
| 92 { "power_manager", DBusClientBundle::POWER_MANAGER }, | 81 { "power_manager", DBusClientBundle::POWER_MANAGER }, |
| 93 { "session_manager", DBusClientBundle::SESSION_MANAGER }, | 82 { "session_manager", DBusClientBundle::SESSION_MANAGER }, |
| 94 { "sms", DBusClientBundle::SMS }, | 83 { "sms", DBusClientBundle::SMS }, |
| 95 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, | 84 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, |
| 96 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, | 85 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, |
| 97 }; | 86 }; |
| 98 | 87 |
| 99 // Parses single command line param value for dbus subsystem. If successful, | 88 // Parses single command line param value for dbus subsystem. If successful, |
| 100 // returns its enum representation. Otherwise returns NO_CLIENT. | 89 // returns its enum representation. Otherwise returns NO_CLIENT. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (!IsUsingStub(INTROSPECTABLE)) | 171 if (!IsUsingStub(INTROSPECTABLE)) |
| 183 introspectable_client_.reset(IntrospectableClient::Create()); | 172 introspectable_client_.reset(IntrospectableClient::Create()); |
| 184 else | 173 else |
| 185 introspectable_client_.reset(new FakeIntrospectableClient); | 174 introspectable_client_.reset(new FakeIntrospectableClient); |
| 186 | 175 |
| 187 if (!IsUsingStub(MODEM_MESSAGING)) | 176 if (!IsUsingStub(MODEM_MESSAGING)) |
| 188 modem_messaging_client_.reset(ModemMessagingClient::Create()); | 177 modem_messaging_client_.reset(ModemMessagingClient::Create()); |
| 189 else | 178 else |
| 190 modem_messaging_client_.reset(new FakeModemMessagingClient); | 179 modem_messaging_client_.reset(new FakeModemMessagingClient); |
| 191 | 180 |
| 192 // Create the NFC clients in the correct order based on their dependencies. | |
| 193 if (!IsUsingStub(NFC)) { | |
| 194 nfc_manager_client_.reset(NfcManagerClient::Create()); | |
| 195 nfc_adapter_client_.reset( | |
| 196 NfcAdapterClient::Create(nfc_manager_client_.get())); | |
| 197 nfc_device_client_.reset( | |
| 198 NfcDeviceClient::Create(nfc_adapter_client_.get())); | |
| 199 nfc_tag_client_.reset(NfcTagClient::Create(nfc_adapter_client_.get())); | |
| 200 nfc_record_client_.reset(NfcRecordClient::Create(nfc_device_client_.get(), | |
| 201 nfc_tag_client_.get())); | |
| 202 } else { | |
| 203 nfc_manager_client_.reset(new FakeNfcManagerClient); | |
| 204 nfc_adapter_client_.reset(new FakeNfcAdapterClient); | |
| 205 nfc_device_client_.reset(new FakeNfcDeviceClient); | |
| 206 nfc_tag_client_.reset(new FakeNfcTagClient); | |
| 207 nfc_record_client_.reset(new FakeNfcRecordClient); | |
| 208 } | |
| 209 | |
| 210 if (!IsUsingStub(PERMISSION_BROKER)) | 181 if (!IsUsingStub(PERMISSION_BROKER)) |
| 211 permission_broker_client_.reset(PermissionBrokerClient::Create()); | 182 permission_broker_client_.reset(PermissionBrokerClient::Create()); |
| 212 else | 183 else |
| 213 permission_broker_client_.reset(new FakePermissionBrokerClient); | 184 permission_broker_client_.reset(new FakePermissionBrokerClient); |
| 214 | 185 |
| 215 power_manager_client_.reset(PowerManagerClient::Create( | 186 power_manager_client_.reset(PowerManagerClient::Create( |
| 216 IsUsingStub(POWER_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION | 187 IsUsingStub(POWER_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
| 217 : REAL_DBUS_CLIENT_IMPLEMENTATION)); | 188 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
| 218 | 189 |
| 219 session_manager_client_.reset(SessionManagerClient::Create( | 190 session_manager_client_.reset(SessionManagerClient::Create( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 unstub_mask |= client; | 237 unstub_mask |= client; |
| 267 } else { | 238 } else { |
| 268 LOG(ERROR) << "Unknown dbus client: " << cur; | 239 LOG(ERROR) << "Unknown dbus client: " << cur; |
| 269 } | 240 } |
| 270 } | 241 } |
| 271 | 242 |
| 272 return unstub_mask; | 243 return unstub_mask; |
| 273 } | 244 } |
| 274 | 245 |
| 275 } // namespace chromeos | 246 } // namespace chromeos |
| OLD | NEW |