| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "chromeos/chromeos_switches.h" | 12 #include "chromeos/chromeos_switches.h" |
| 13 #include "chromeos/dbus/amplifier_client.h" | 13 #include "chromeos/dbus/amplifier_client.h" |
| 14 #include "chromeos/dbus/ap_manager_client.h" | 14 #include "chromeos/dbus/ap_manager_client.h" |
| 15 #include "chromeos/dbus/arc_bridge_client.h" | 15 #include "chromeos/dbus/arc_instance_client.h" |
| 16 #include "chromeos/dbus/audio_dsp_client.h" | 16 #include "chromeos/dbus/audio_dsp_client.h" |
| 17 #include "chromeos/dbus/bluetooth_adapter_client.h" | 17 #include "chromeos/dbus/bluetooth_adapter_client.h" |
| 18 #include "chromeos/dbus/bluetooth_agent_manager_client.h" | 18 #include "chromeos/dbus/bluetooth_agent_manager_client.h" |
| 19 #include "chromeos/dbus/bluetooth_device_client.h" | 19 #include "chromeos/dbus/bluetooth_device_client.h" |
| 20 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h" | 20 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h" |
| 21 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | 21 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" |
| 22 #include "chromeos/dbus/bluetooth_gatt_manager_client.h" | 22 #include "chromeos/dbus/bluetooth_gatt_manager_client.h" |
| 23 #include "chromeos/dbus/bluetooth_gatt_service_client.h" | 23 #include "chromeos/dbus/bluetooth_gatt_service_client.h" |
| 24 #include "chromeos/dbus/bluetooth_input_client.h" | 24 #include "chromeos/dbus/bluetooth_input_client.h" |
| 25 #include "chromeos/dbus/bluetooth_le_advertising_manager_client.h" | 25 #include "chromeos/dbus/bluetooth_le_advertising_manager_client.h" |
| 26 #include "chromeos/dbus/bluetooth_media_client.h" | 26 #include "chromeos/dbus/bluetooth_media_client.h" |
| 27 #include "chromeos/dbus/bluetooth_media_transport_client.h" | 27 #include "chromeos/dbus/bluetooth_media_transport_client.h" |
| 28 #include "chromeos/dbus/bluetooth_profile_manager_client.h" | 28 #include "chromeos/dbus/bluetooth_profile_manager_client.h" |
| 29 #include "chromeos/dbus/cras_audio_client.h" | 29 #include "chromeos/dbus/cras_audio_client.h" |
| 30 #include "chromeos/dbus/cros_disks_client.h" | 30 #include "chromeos/dbus/cros_disks_client.h" |
| 31 #include "chromeos/dbus/cryptohome_client.h" | 31 #include "chromeos/dbus/cryptohome_client.h" |
| 32 #include "chromeos/dbus/debug_daemon_client.h" | 32 #include "chromeos/dbus/debug_daemon_client.h" |
| 33 #include "chromeos/dbus/easy_unlock_client.h" | 33 #include "chromeos/dbus/easy_unlock_client.h" |
| 34 #include "chromeos/dbus/fake_amplifier_client.h" | 34 #include "chromeos/dbus/fake_amplifier_client.h" |
| 35 #include "chromeos/dbus/fake_ap_manager_client.h" | 35 #include "chromeos/dbus/fake_ap_manager_client.h" |
| 36 #include "chromeos/dbus/fake_arc_bridge_client.h" | 36 #include "chromeos/dbus/fake_arc_instance_client.h" |
| 37 #include "chromeos/dbus/fake_audio_dsp_client.h" | 37 #include "chromeos/dbus/fake_audio_dsp_client.h" |
| 38 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 38 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
| 39 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" | 39 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" |
| 40 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 40 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
| 41 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" | 41 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" |
| 42 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" | 42 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" |
| 43 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" | 43 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" |
| 44 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" | 44 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" |
| 45 #include "chromeos/dbus/fake_bluetooth_input_client.h" | 45 #include "chromeos/dbus/fake_bluetooth_input_client.h" |
| 46 #include "chromeos/dbus/fake_bluetooth_le_advertising_manager_client.h" | 46 #include "chromeos/dbus/fake_bluetooth_le_advertising_manager_client.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 namespace { | 103 namespace { |
| 104 | 104 |
| 105 // Command line switch mapping for --dbus-unstub-clients. | 105 // Command line switch mapping for --dbus-unstub-clients. |
| 106 const struct { | 106 const struct { |
| 107 const char* param_name; | 107 const char* param_name; |
| 108 DBusClientBundle::DBusClientType client_type; | 108 DBusClientBundle::DBusClientType client_type; |
| 109 } client_type_map[] = { | 109 } client_type_map[] = { |
| 110 { "amplifier", DBusClientBundle::AMPLIFIER }, | 110 { "amplifier", DBusClientBundle::AMPLIFIER }, |
| 111 { "ap", DBusClientBundle::AP_MANAGER }, | 111 { "ap", DBusClientBundle::AP_MANAGER }, |
| 112 { "arc", DBusClientBundle::ARC_BRIDGE }, | 112 { "arc", DBusClientBundle::ARC_INSTANCE }, |
| 113 { "audio_dsp", DBusClientBundle::AUDIO_DSP }, | 113 { "audio_dsp", DBusClientBundle::AUDIO_DSP }, |
| 114 { "bluetooth", DBusClientBundle::BLUETOOTH }, | 114 { "bluetooth", DBusClientBundle::BLUETOOTH }, |
| 115 { "cras", DBusClientBundle::CRAS }, | 115 { "cras", DBusClientBundle::CRAS }, |
| 116 { "cros_disks", DBusClientBundle::CROS_DISKS }, | 116 { "cros_disks", DBusClientBundle::CROS_DISKS }, |
| 117 { "cryptohome", DBusClientBundle::CRYPTOHOME }, | 117 { "cryptohome", DBusClientBundle::CRYPTOHOME }, |
| 118 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, | 118 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, |
| 119 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, | 119 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, |
| 120 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, | 120 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, |
| 121 { "shill", DBusClientBundle::SHILL }, | 121 { "shill", DBusClientBundle::SHILL }, |
| 122 { "gsm_sms", DBusClientBundle::GSM_SMS }, | 122 { "gsm_sms", DBusClientBundle::GSM_SMS }, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 148 | 148 |
| 149 } // namespace | 149 } // namespace |
| 150 | 150 |
| 151 DBusClientBundle::DBusClientBundle(DBusClientTypeMask unstub_client_mask) | 151 DBusClientBundle::DBusClientBundle(DBusClientTypeMask unstub_client_mask) |
| 152 : unstub_client_mask_(unstub_client_mask) { | 152 : unstub_client_mask_(unstub_client_mask) { |
| 153 if (!IsUsingStub(AMPLIFIER)) | 153 if (!IsUsingStub(AMPLIFIER)) |
| 154 amplifier_client_.reset(AmplifierClient::Create()); | 154 amplifier_client_.reset(AmplifierClient::Create()); |
| 155 else | 155 else |
| 156 amplifier_client_.reset(new FakeAmplifierClient); | 156 amplifier_client_.reset(new FakeAmplifierClient); |
| 157 | 157 |
| 158 if (!IsUsingStub(ARC_BRIDGE)) | 158 if (!IsUsingStub(ARC_INSTANCE)) |
| 159 arc_bridge_client_.reset(ArcBridgeClient::Create()); | 159 arc_instance_client_.reset(ArcInstanceClient::Create()); |
| 160 else | 160 else |
| 161 arc_bridge_client_.reset(new FakeArcBridgeClient); | 161 arc_instance_client_.reset(new FakeArcInstanceClient); |
| 162 | 162 |
| 163 if (!IsUsingStub(AUDIO_DSP)) | 163 if (!IsUsingStub(AUDIO_DSP)) |
| 164 audio_dsp_client_.reset(AudioDspClient::Create()); | 164 audio_dsp_client_.reset(AudioDspClient::Create()); |
| 165 else | 165 else |
| 166 audio_dsp_client_.reset(new FakeAudioDspClient); | 166 audio_dsp_client_.reset(new FakeAudioDspClient); |
| 167 | 167 |
| 168 if (!IsUsingStub(BLUETOOTH)) { | 168 if (!IsUsingStub(BLUETOOTH)) { |
| 169 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create()); | 169 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create()); |
| 170 bluetooth_le_advertising_manager_client_.reset( | 170 bluetooth_le_advertising_manager_client_.reset( |
| 171 BluetoothLEAdvertisingManagerClient::Create()); | 171 BluetoothLEAdvertisingManagerClient::Create()); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 unstub_mask |= client; | 368 unstub_mask |= client; |
| 369 } else { | 369 } else { |
| 370 LOG(ERROR) << "Unknown dbus client: " << cur; | 370 LOG(ERROR) << "Unknown dbus client: " << cur; |
| 371 } | 371 } |
| 372 } | 372 } |
| 373 | 373 |
| 374 return unstub_mask; | 374 return unstub_mask; |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace chromeos | 377 } // namespace chromeos |
| OLD | NEW |