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/audio_dsp_client.h" | 15 #include "chromeos/dbus/audio_dsp_client.h" |
16 #include "chromeos/dbus/bluetooth_adapter_client.h" | |
17 #include "chromeos/dbus/bluetooth_agent_manager_client.h" | |
18 #include "chromeos/dbus/bluetooth_device_client.h" | |
19 #include "chromeos/dbus/bluetooth_gatt_characteristic_client.h" | |
20 #include "chromeos/dbus/bluetooth_gatt_descriptor_client.h" | |
21 #include "chromeos/dbus/bluetooth_gatt_manager_client.h" | |
22 #include "chromeos/dbus/bluetooth_gatt_service_client.h" | |
23 #include "chromeos/dbus/bluetooth_input_client.h" | |
24 #include "chromeos/dbus/bluetooth_le_advertising_manager_client.h" | |
25 #include "chromeos/dbus/bluetooth_media_client.h" | |
26 #include "chromeos/dbus/bluetooth_media_transport_client.h" | |
27 #include "chromeos/dbus/bluetooth_profile_manager_client.h" | |
28 #include "chromeos/dbus/cras_audio_client.h" | 16 #include "chromeos/dbus/cras_audio_client.h" |
29 #include "chromeos/dbus/cros_disks_client.h" | 17 #include "chromeos/dbus/cros_disks_client.h" |
30 #include "chromeos/dbus/cryptohome_client.h" | 18 #include "chromeos/dbus/cryptohome_client.h" |
31 #include "chromeos/dbus/debug_daemon_client.h" | 19 #include "chromeos/dbus/debug_daemon_client.h" |
32 #include "chromeos/dbus/easy_unlock_client.h" | 20 #include "chromeos/dbus/easy_unlock_client.h" |
33 #include "chromeos/dbus/fake_amplifier_client.h" | 21 #include "chromeos/dbus/fake_amplifier_client.h" |
34 #include "chromeos/dbus/fake_ap_manager_client.h" | 22 #include "chromeos/dbus/fake_ap_manager_client.h" |
35 #include "chromeos/dbus/fake_audio_dsp_client.h" | 23 #include "chromeos/dbus/fake_audio_dsp_client.h" |
36 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | |
37 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" | |
38 #include "chromeos/dbus/fake_bluetooth_device_client.h" | |
39 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" | |
40 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" | |
41 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" | |
42 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" | |
43 #include "chromeos/dbus/fake_bluetooth_input_client.h" | |
44 #include "chromeos/dbus/fake_bluetooth_le_advertising_manager_client.h" | |
45 #include "chromeos/dbus/fake_bluetooth_media_client.h" | |
46 #include "chromeos/dbus/fake_bluetooth_media_transport_client.h" | |
47 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" | |
48 #include "chromeos/dbus/fake_cras_audio_client.h" | 24 #include "chromeos/dbus/fake_cras_audio_client.h" |
49 #include "chromeos/dbus/fake_cryptohome_client.h" | 25 #include "chromeos/dbus/fake_cryptohome_client.h" |
50 #include "chromeos/dbus/fake_debug_daemon_client.h" | 26 #include "chromeos/dbus/fake_debug_daemon_client.h" |
51 #include "chromeos/dbus/fake_easy_unlock_client.h" | 27 #include "chromeos/dbus/fake_easy_unlock_client.h" |
52 #include "chromeos/dbus/fake_gsm_sms_client.h" | 28 #include "chromeos/dbus/fake_gsm_sms_client.h" |
53 #include "chromeos/dbus/fake_image_burner_client.h" | 29 #include "chromeos/dbus/fake_image_burner_client.h" |
54 #include "chromeos/dbus/fake_introspectable_client.h" | 30 #include "chromeos/dbus/fake_introspectable_client.h" |
55 #include "chromeos/dbus/fake_lorgnette_manager_client.h" | 31 #include "chromeos/dbus/fake_lorgnette_manager_client.h" |
56 #include "chromeos/dbus/fake_modem_messaging_client.h" | 32 #include "chromeos/dbus/fake_modem_messaging_client.h" |
57 #include "chromeos/dbus/fake_nfc_adapter_client.h" | 33 #include "chromeos/dbus/fake_nfc_adapter_client.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (!IsUsingStub(AMPLIFIER)) | 126 if (!IsUsingStub(AMPLIFIER)) |
151 amplifier_client_.reset(AmplifierClient::Create()); | 127 amplifier_client_.reset(AmplifierClient::Create()); |
152 else | 128 else |
153 amplifier_client_.reset(new FakeAmplifierClient); | 129 amplifier_client_.reset(new FakeAmplifierClient); |
154 | 130 |
155 if (!IsUsingStub(AUDIO_DSP)) | 131 if (!IsUsingStub(AUDIO_DSP)) |
156 audio_dsp_client_.reset(AudioDspClient::Create()); | 132 audio_dsp_client_.reset(AudioDspClient::Create()); |
157 else | 133 else |
158 audio_dsp_client_.reset(new FakeAudioDspClient); | 134 audio_dsp_client_.reset(new FakeAudioDspClient); |
159 | 135 |
160 if (!IsUsingStub(BLUETOOTH)) { | |
161 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create()); | |
162 bluetooth_le_advertising_manager_client_.reset( | |
163 BluetoothLEAdvertisingManagerClient::Create()); | |
164 bluetooth_agent_manager_client_.reset( | |
165 BluetoothAgentManagerClient::Create()); | |
166 bluetooth_device_client_.reset(BluetoothDeviceClient::Create()); | |
167 bluetooth_input_client_.reset(BluetoothInputClient::Create()); | |
168 bluetooth_media_client_.reset(BluetoothMediaClient::Create()); | |
169 bluetooth_media_transport_client_.reset( | |
170 BluetoothMediaTransportClient::Create()); | |
171 bluetooth_profile_manager_client_.reset( | |
172 BluetoothProfileManagerClient::Create()); | |
173 bluetooth_gatt_characteristic_client_.reset( | |
174 BluetoothGattCharacteristicClient::Create()); | |
175 bluetooth_gatt_descriptor_client_.reset( | |
176 BluetoothGattDescriptorClient::Create()); | |
177 bluetooth_gatt_manager_client_.reset( | |
178 BluetoothGattManagerClient::Create()); | |
179 bluetooth_gatt_service_client_.reset( | |
180 BluetoothGattServiceClient::Create()); | |
181 } else { | |
182 bluetooth_adapter_client_.reset(new FakeBluetoothAdapterClient); | |
183 bluetooth_le_advertising_manager_client_.reset( | |
184 new FakeBluetoothLEAdvertisingManagerClient); | |
185 bluetooth_agent_manager_client_.reset(new FakeBluetoothAgentManagerClient); | |
186 bluetooth_device_client_.reset(new FakeBluetoothDeviceClient); | |
187 bluetooth_input_client_.reset(new FakeBluetoothInputClient); | |
188 bluetooth_media_client_.reset(new FakeBluetoothMediaClient); | |
189 bluetooth_media_transport_client_.reset( | |
190 new FakeBluetoothMediaTransportClient); | |
191 bluetooth_profile_manager_client_.reset( | |
192 new FakeBluetoothProfileManagerClient); | |
193 bluetooth_gatt_characteristic_client_.reset( | |
194 new FakeBluetoothGattCharacteristicClient); | |
195 bluetooth_gatt_descriptor_client_.reset( | |
196 new FakeBluetoothGattDescriptorClient); | |
197 bluetooth_gatt_manager_client_.reset(new FakeBluetoothGattManagerClient); | |
198 bluetooth_gatt_service_client_.reset(new FakeBluetoothGattServiceClient); | |
199 } | |
200 | |
201 if (!IsUsingStub(CRAS)) | 136 if (!IsUsingStub(CRAS)) |
202 cras_audio_client_.reset(CrasAudioClient::Create()); | 137 cras_audio_client_.reset(CrasAudioClient::Create()); |
203 else | 138 else |
204 cras_audio_client_.reset(new FakeCrasAudioClient); | 139 cras_audio_client_.reset(new FakeCrasAudioClient); |
205 | 140 |
206 cros_disks_client_.reset(CrosDisksClient::Create( | 141 cros_disks_client_.reset(CrosDisksClient::Create( |
207 IsUsingStub(CROS_DISKS) ? STUB_DBUS_CLIENT_IMPLEMENTATION | 142 IsUsingStub(CROS_DISKS) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
208 : REAL_DBUS_CLIENT_IMPLEMENTATION)); | 143 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
209 | 144 |
210 if (!IsUsingStub(CRYPTOHOME)) | 145 if (!IsUsingStub(CRYPTOHOME)) |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 unstub_mask |= client; | 297 unstub_mask |= client; |
363 } else { | 298 } else { |
364 LOG(ERROR) << "Unknown dbus client: " << cur; | 299 LOG(ERROR) << "Unknown dbus client: " << cur; |
365 } | 300 } |
366 } | 301 } |
367 | 302 |
368 return unstub_mask; | 303 return unstub_mask; |
369 } | 304 } |
370 | 305 |
371 } // namespace chromeos | 306 } // namespace chromeos |
OLD | NEW |