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