| 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 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "chromeos/chromeos_switches.h" | 14 #include "chromeos/chromeos_switches.h" |
| 15 #include "chromeos/dbus/arc_obb_mounter_client.h" | 15 #include "chromeos/dbus/arc_obb_mounter_client.h" |
| 16 #include "chromeos/dbus/cras_audio_client.h" | 16 #include "chromeos/dbus/cras_audio_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/debug_daemon_client.h" | 19 #include "chromeos/dbus/debug_daemon_client.h" |
| 20 #include "chromeos/dbus/easy_unlock_client.h" | 20 #include "chromeos/dbus/easy_unlock_client.h" |
| 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" | |
| 29 #include "chromeos/dbus/fake_lorgnette_manager_client.h" | 28 #include "chromeos/dbus/fake_lorgnette_manager_client.h" |
| 30 #include "chromeos/dbus/fake_modem_messaging_client.h" | 29 #include "chromeos/dbus/fake_modem_messaging_client.h" |
| 31 #include "chromeos/dbus/fake_permission_broker_client.h" | 30 #include "chromeos/dbus/fake_permission_broker_client.h" |
| 32 #include "chromeos/dbus/fake_shill_device_client.h" | 31 #include "chromeos/dbus/fake_shill_device_client.h" |
| 33 #include "chromeos/dbus/fake_shill_ipconfig_client.h" | 32 #include "chromeos/dbus/fake_shill_ipconfig_client.h" |
| 34 #include "chromeos/dbus/fake_shill_manager_client.h" | 33 #include "chromeos/dbus/fake_shill_manager_client.h" |
| 35 #include "chromeos/dbus/fake_shill_profile_client.h" | 34 #include "chromeos/dbus/fake_shill_profile_client.h" |
| 36 #include "chromeos/dbus/fake_shill_service_client.h" | 35 #include "chromeos/dbus/fake_shill_service_client.h" |
| 37 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" | 36 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" |
| 38 #include "chromeos/dbus/fake_sms_client.h" | 37 #include "chromeos/dbus/fake_sms_client.h" |
| 39 #include "chromeos/dbus/fake_system_clock_client.h" | 38 #include "chromeos/dbus/fake_system_clock_client.h" |
| 40 #include "chromeos/dbus/gsm_sms_client.h" | 39 #include "chromeos/dbus/gsm_sms_client.h" |
| 41 #include "chromeos/dbus/image_burner_client.h" | 40 #include "chromeos/dbus/image_burner_client.h" |
| 42 #include "chromeos/dbus/introspectable_client.h" | |
| 43 #include "chromeos/dbus/lorgnette_manager_client.h" | 41 #include "chromeos/dbus/lorgnette_manager_client.h" |
| 44 #include "chromeos/dbus/modem_messaging_client.h" | 42 #include "chromeos/dbus/modem_messaging_client.h" |
| 45 #include "chromeos/dbus/permission_broker_client.h" | 43 #include "chromeos/dbus/permission_broker_client.h" |
| 46 #include "chromeos/dbus/power_manager_client.h" | 44 #include "chromeos/dbus/power_manager_client.h" |
| 47 #include "chromeos/dbus/power_policy_controller.h" | 45 #include "chromeos/dbus/power_policy_controller.h" |
| 48 #include "chromeos/dbus/session_manager_client.h" | 46 #include "chromeos/dbus/session_manager_client.h" |
| 49 #include "chromeos/dbus/shill_device_client.h" | 47 #include "chromeos/dbus/shill_device_client.h" |
| 50 #include "chromeos/dbus/shill_ipconfig_client.h" | 48 #include "chromeos/dbus/shill_ipconfig_client.h" |
| 51 #include "chromeos/dbus/shill_manager_client.h" | 49 #include "chromeos/dbus/shill_manager_client.h" |
| 52 #include "chromeos/dbus/shill_profile_client.h" | 50 #include "chromeos/dbus/shill_profile_client.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 { "bluetooth", DBusClientBundle::BLUETOOTH }, | 66 { "bluetooth", DBusClientBundle::BLUETOOTH }, |
| 69 { "cras", DBusClientBundle::CRAS }, | 67 { "cras", DBusClientBundle::CRAS }, |
| 70 { "cros_disks", DBusClientBundle::CROS_DISKS }, | 68 { "cros_disks", DBusClientBundle::CROS_DISKS }, |
| 71 { "cryptohome", DBusClientBundle::CRYPTOHOME }, | 69 { "cryptohome", DBusClientBundle::CRYPTOHOME }, |
| 72 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, | 70 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, |
| 73 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, | 71 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, |
| 74 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, | 72 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, |
| 75 { "shill", DBusClientBundle::SHILL }, | 73 { "shill", DBusClientBundle::SHILL }, |
| 76 { "gsm_sms", DBusClientBundle::GSM_SMS }, | 74 { "gsm_sms", DBusClientBundle::GSM_SMS }, |
| 77 { "image_burner", DBusClientBundle::IMAGE_BURNER }, | 75 { "image_burner", DBusClientBundle::IMAGE_BURNER }, |
| 78 { "introspectable", DBusClientBundle::INTROSPECTABLE }, | |
| 79 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, | 76 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, |
| 80 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, | 77 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, |
| 81 { "power_manager", DBusClientBundle::POWER_MANAGER }, | 78 { "power_manager", DBusClientBundle::POWER_MANAGER }, |
| 82 { "session_manager", DBusClientBundle::SESSION_MANAGER }, | 79 { "session_manager", DBusClientBundle::SESSION_MANAGER }, |
| 83 { "sms", DBusClientBundle::SMS }, | 80 { "sms", DBusClientBundle::SMS }, |
| 84 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, | 81 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, |
| 85 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, | 82 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, |
| 86 }; | 83 }; |
| 87 | 84 |
| 88 // Parses single command line param value for dbus subsystem. If successful, | 85 // Parses single command line param value for dbus subsystem. If successful, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 base::CommandLine::ForCurrentProcess()->HasSwitch( | 158 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 162 chromeos::switches::kSmsTestMessages)); | 159 chromeos::switches::kSmsTestMessages)); |
| 163 gsm_sms_client_.reset(gsm_sms_client); | 160 gsm_sms_client_.reset(gsm_sms_client); |
| 164 } | 161 } |
| 165 | 162 |
| 166 if (!IsUsingStub(IMAGE_BURNER)) | 163 if (!IsUsingStub(IMAGE_BURNER)) |
| 167 image_burner_client_.reset(ImageBurnerClient::Create()); | 164 image_burner_client_.reset(ImageBurnerClient::Create()); |
| 168 else | 165 else |
| 169 image_burner_client_.reset(new FakeImageBurnerClient); | 166 image_burner_client_.reset(new FakeImageBurnerClient); |
| 170 | 167 |
| 171 if (!IsUsingStub(INTROSPECTABLE)) | |
| 172 introspectable_client_.reset(IntrospectableClient::Create()); | |
| 173 else | |
| 174 introspectable_client_.reset(new FakeIntrospectableClient); | |
| 175 | |
| 176 if (!IsUsingStub(MODEM_MESSAGING)) | 168 if (!IsUsingStub(MODEM_MESSAGING)) |
| 177 modem_messaging_client_.reset(ModemMessagingClient::Create()); | 169 modem_messaging_client_.reset(ModemMessagingClient::Create()); |
| 178 else | 170 else |
| 179 modem_messaging_client_.reset(new FakeModemMessagingClient); | 171 modem_messaging_client_.reset(new FakeModemMessagingClient); |
| 180 | 172 |
| 181 if (!IsUsingStub(PERMISSION_BROKER)) | 173 if (!IsUsingStub(PERMISSION_BROKER)) |
| 182 permission_broker_client_.reset(PermissionBrokerClient::Create()); | 174 permission_broker_client_.reset(PermissionBrokerClient::Create()); |
| 183 else | 175 else |
| 184 permission_broker_client_.reset(new FakePermissionBrokerClient); | 176 permission_broker_client_.reset(new FakePermissionBrokerClient); |
| 185 | 177 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 unstub_mask |= client; | 229 unstub_mask |= client; |
| 238 } else { | 230 } else { |
| 239 LOG(ERROR) << "Unknown dbus client: " << cur; | 231 LOG(ERROR) << "Unknown dbus client: " << cur; |
| 240 } | 232 } |
| 241 } | 233 } |
| 242 | 234 |
| 243 return unstub_mask; | 235 return unstub_mask; |
| 244 } | 236 } |
| 245 | 237 |
| 246 } // namespace chromeos | 238 } // namespace chromeos |
| OLD | NEW |