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/ap_manager_client.h" | |
16 #include "chromeos/dbus/arc_obb_mounter_client.h" | 15 #include "chromeos/dbus/arc_obb_mounter_client.h" |
17 #include "chromeos/dbus/cras_audio_client.h" | 16 #include "chromeos/dbus/cras_audio_client.h" |
18 #include "chromeos/dbus/cros_disks_client.h" | 17 #include "chromeos/dbus/cros_disks_client.h" |
19 #include "chromeos/dbus/cryptohome_client.h" | 18 #include "chromeos/dbus/cryptohome_client.h" |
20 #include "chromeos/dbus/debug_daemon_client.h" | 19 #include "chromeos/dbus/debug_daemon_client.h" |
21 #include "chromeos/dbus/easy_unlock_client.h" | 20 #include "chromeos/dbus/easy_unlock_client.h" |
22 #include "chromeos/dbus/fake_ap_manager_client.h" | |
23 #include "chromeos/dbus/fake_arc_obb_mounter_client.h" | 21 #include "chromeos/dbus/fake_arc_obb_mounter_client.h" |
24 #include "chromeos/dbus/fake_cras_audio_client.h" | 22 #include "chromeos/dbus/fake_cras_audio_client.h" |
25 #include "chromeos/dbus/fake_cryptohome_client.h" | 23 #include "chromeos/dbus/fake_cryptohome_client.h" |
26 #include "chromeos/dbus/fake_debug_daemon_client.h" | 24 #include "chromeos/dbus/fake_debug_daemon_client.h" |
27 #include "chromeos/dbus/fake_easy_unlock_client.h" | 25 #include "chromeos/dbus/fake_easy_unlock_client.h" |
28 #include "chromeos/dbus/fake_gsm_sms_client.h" | 26 #include "chromeos/dbus/fake_gsm_sms_client.h" |
29 #include "chromeos/dbus/fake_image_burner_client.h" | 27 #include "chromeos/dbus/fake_image_burner_client.h" |
30 #include "chromeos/dbus/fake_introspectable_client.h" | 28 #include "chromeos/dbus/fake_introspectable_client.h" |
31 #include "chromeos/dbus/fake_lorgnette_manager_client.h" | 29 #include "chromeos/dbus/fake_lorgnette_manager_client.h" |
32 #include "chromeos/dbus/fake_modem_messaging_client.h" | 30 #include "chromeos/dbus/fake_modem_messaging_client.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 70 |
73 namespace chromeos { | 71 namespace chromeos { |
74 | 72 |
75 namespace { | 73 namespace { |
76 | 74 |
77 // Command line switch mapping for --dbus-unstub-clients. | 75 // Command line switch mapping for --dbus-unstub-clients. |
78 const struct { | 76 const struct { |
79 const char* param_name; | 77 const char* param_name; |
80 DBusClientBundle::DBusClientType client_type; | 78 DBusClientBundle::DBusClientType client_type; |
81 } client_type_map[] = { | 79 } client_type_map[] = { |
82 { "ap", DBusClientBundle::AP_MANAGER }, | |
83 { "bluetooth", DBusClientBundle::BLUETOOTH }, | 80 { "bluetooth", DBusClientBundle::BLUETOOTH }, |
84 { "cras", DBusClientBundle::CRAS }, | 81 { "cras", DBusClientBundle::CRAS }, |
85 { "cros_disks", DBusClientBundle::CROS_DISKS }, | 82 { "cros_disks", DBusClientBundle::CROS_DISKS }, |
86 { "cryptohome", DBusClientBundle::CRYPTOHOME }, | 83 { "cryptohome", DBusClientBundle::CRYPTOHOME }, |
87 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, | 84 { "debug_daemon", DBusClientBundle::DEBUG_DAEMON }, |
88 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, | 85 { "easy_unlock", DBusClientBundle::EASY_UNLOCK }, |
89 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, | 86 { "lorgnette_manager", DBusClientBundle::LORGNETTE_MANAGER }, |
90 { "shill", DBusClientBundle::SHILL }, | 87 { "shill", DBusClientBundle::SHILL }, |
91 { "gsm_sms", DBusClientBundle::GSM_SMS }, | 88 { "gsm_sms", DBusClientBundle::GSM_SMS }, |
92 { "image_burner", DBusClientBundle::IMAGE_BURNER }, | 89 { "image_burner", DBusClientBundle::IMAGE_BURNER }, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (!IsUsingStub(PEER_DAEMON)) | 213 if (!IsUsingStub(PEER_DAEMON)) |
217 peer_daemon_manager_client_.reset(PeerDaemonManagerClient::Create()); | 214 peer_daemon_manager_client_.reset(PeerDaemonManagerClient::Create()); |
218 else | 215 else |
219 peer_daemon_manager_client_.reset(new FakePeerDaemonManagerClient); | 216 peer_daemon_manager_client_.reset(new FakePeerDaemonManagerClient); |
220 | 217 |
221 if (!IsUsingStub(PERMISSION_BROKER)) | 218 if (!IsUsingStub(PERMISSION_BROKER)) |
222 permission_broker_client_.reset(PermissionBrokerClient::Create()); | 219 permission_broker_client_.reset(PermissionBrokerClient::Create()); |
223 else | 220 else |
224 permission_broker_client_.reset(new FakePermissionBrokerClient); | 221 permission_broker_client_.reset(new FakePermissionBrokerClient); |
225 | 222 |
226 if (!IsUsingStub(AP_MANAGER)) | |
227 ap_manager_client_.reset(ApManagerClient::Create()); | |
228 else | |
229 ap_manager_client_.reset(new FakeApManagerClient); | |
230 | |
231 power_manager_client_.reset(PowerManagerClient::Create( | 223 power_manager_client_.reset(PowerManagerClient::Create( |
232 IsUsingStub(POWER_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION | 224 IsUsingStub(POWER_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
233 : REAL_DBUS_CLIENT_IMPLEMENTATION)); | 225 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
234 | 226 |
235 session_manager_client_.reset(SessionManagerClient::Create( | 227 session_manager_client_.reset(SessionManagerClient::Create( |
236 IsUsingStub(SESSION_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION | 228 IsUsingStub(SESSION_MANAGER) ? STUB_DBUS_CLIENT_IMPLEMENTATION |
237 : REAL_DBUS_CLIENT_IMPLEMENTATION)); | 229 : REAL_DBUS_CLIENT_IMPLEMENTATION)); |
238 | 230 |
239 if (!IsUsingStub(SMS)) | 231 if (!IsUsingStub(SMS)) |
240 sms_client_.reset(SMSClient::Create()); | 232 sms_client_.reset(SMSClient::Create()); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 unstub_mask |= client; | 274 unstub_mask |= client; |
283 } else { | 275 } else { |
284 LOG(ERROR) << "Unknown dbus client: " << cur; | 276 LOG(ERROR) << "Unknown dbus client: " << cur; |
285 } | 277 } |
286 } | 278 } |
287 | 279 |
288 return unstub_mask; | 280 return unstub_mask; |
289 } | 281 } |
290 | 282 |
291 } // namespace chromeos | 283 } // namespace chromeos |
OLD | NEW |