| 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" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chromeos/dbus/fake_leadership_daemon_manager_client.h" | 49 #include "chromeos/dbus/fake_leadership_daemon_manager_client.h" |
| 50 #include "chromeos/dbus/fake_lorgnette_manager_client.h" | 50 #include "chromeos/dbus/fake_lorgnette_manager_client.h" |
| 51 #include "chromeos/dbus/fake_modem_messaging_client.h" | 51 #include "chromeos/dbus/fake_modem_messaging_client.h" |
| 52 #include "chromeos/dbus/fake_nfc_adapter_client.h" | 52 #include "chromeos/dbus/fake_nfc_adapter_client.h" |
| 53 #include "chromeos/dbus/fake_nfc_device_client.h" | 53 #include "chromeos/dbus/fake_nfc_device_client.h" |
| 54 #include "chromeos/dbus/fake_nfc_manager_client.h" | 54 #include "chromeos/dbus/fake_nfc_manager_client.h" |
| 55 #include "chromeos/dbus/fake_nfc_record_client.h" | 55 #include "chromeos/dbus/fake_nfc_record_client.h" |
| 56 #include "chromeos/dbus/fake_nfc_tag_client.h" | 56 #include "chromeos/dbus/fake_nfc_tag_client.h" |
| 57 #include "chromeos/dbus/fake_peer_daemon_manager_client.h" | 57 #include "chromeos/dbus/fake_peer_daemon_manager_client.h" |
| 58 #include "chromeos/dbus/fake_permission_broker_client.h" | 58 #include "chromeos/dbus/fake_permission_broker_client.h" |
| 59 #include "chromeos/dbus/fake_privet_daemon_manager_client.h" |
| 59 #include "chromeos/dbus/fake_shill_device_client.h" | 60 #include "chromeos/dbus/fake_shill_device_client.h" |
| 60 #include "chromeos/dbus/fake_shill_ipconfig_client.h" | 61 #include "chromeos/dbus/fake_shill_ipconfig_client.h" |
| 61 #include "chromeos/dbus/fake_shill_manager_client.h" | 62 #include "chromeos/dbus/fake_shill_manager_client.h" |
| 62 #include "chromeos/dbus/fake_shill_profile_client.h" | 63 #include "chromeos/dbus/fake_shill_profile_client.h" |
| 63 #include "chromeos/dbus/fake_shill_service_client.h" | 64 #include "chromeos/dbus/fake_shill_service_client.h" |
| 64 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" | 65 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" |
| 65 #include "chromeos/dbus/fake_sms_client.h" | 66 #include "chromeos/dbus/fake_sms_client.h" |
| 66 #include "chromeos/dbus/fake_system_clock_client.h" | 67 #include "chromeos/dbus/fake_system_clock_client.h" |
| 67 #include "chromeos/dbus/gsm_sms_client.h" | 68 #include "chromeos/dbus/gsm_sms_client.h" |
| 68 #include "chromeos/dbus/image_burner_client.h" | 69 #include "chromeos/dbus/image_burner_client.h" |
| 69 #include "chromeos/dbus/introspectable_client.h" | 70 #include "chromeos/dbus/introspectable_client.h" |
| 70 #include "chromeos/dbus/leadership_daemon_manager_client.h" | 71 #include "chromeos/dbus/leadership_daemon_manager_client.h" |
| 71 #include "chromeos/dbus/lorgnette_manager_client.h" | 72 #include "chromeos/dbus/lorgnette_manager_client.h" |
| 72 #include "chromeos/dbus/metronome_client.h" | 73 #include "chromeos/dbus/metronome_client.h" |
| 73 #include "chromeos/dbus/modem_messaging_client.h" | 74 #include "chromeos/dbus/modem_messaging_client.h" |
| 74 #include "chromeos/dbus/nfc_adapter_client.h" | 75 #include "chromeos/dbus/nfc_adapter_client.h" |
| 75 #include "chromeos/dbus/nfc_device_client.h" | 76 #include "chromeos/dbus/nfc_device_client.h" |
| 76 #include "chromeos/dbus/nfc_manager_client.h" | 77 #include "chromeos/dbus/nfc_manager_client.h" |
| 77 #include "chromeos/dbus/nfc_record_client.h" | 78 #include "chromeos/dbus/nfc_record_client.h" |
| 78 #include "chromeos/dbus/nfc_tag_client.h" | 79 #include "chromeos/dbus/nfc_tag_client.h" |
| 79 #include "chromeos/dbus/peer_daemon_manager_client.h" | 80 #include "chromeos/dbus/peer_daemon_manager_client.h" |
| 80 #include "chromeos/dbus/permission_broker_client.h" | 81 #include "chromeos/dbus/permission_broker_client.h" |
| 81 #include "chromeos/dbus/power_manager_client.h" | 82 #include "chromeos/dbus/power_manager_client.h" |
| 82 #include "chromeos/dbus/power_policy_controller.h" | 83 #include "chromeos/dbus/power_policy_controller.h" |
| 84 #include "chromeos/dbus/privet_daemon_manager_client.h" |
| 83 #include "chromeos/dbus/session_manager_client.h" | 85 #include "chromeos/dbus/session_manager_client.h" |
| 84 #include "chromeos/dbus/shill_device_client.h" | 86 #include "chromeos/dbus/shill_device_client.h" |
| 85 #include "chromeos/dbus/shill_ipconfig_client.h" | 87 #include "chromeos/dbus/shill_ipconfig_client.h" |
| 86 #include "chromeos/dbus/shill_manager_client.h" | 88 #include "chromeos/dbus/shill_manager_client.h" |
| 87 #include "chromeos/dbus/shill_profile_client.h" | 89 #include "chromeos/dbus/shill_profile_client.h" |
| 88 #include "chromeos/dbus/shill_service_client.h" | 90 #include "chromeos/dbus/shill_service_client.h" |
| 89 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h" | 91 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h" |
| 90 #include "chromeos/dbus/sms_client.h" | 92 #include "chromeos/dbus/sms_client.h" |
| 91 #include "chromeos/dbus/system_clock_client.h" | 93 #include "chromeos/dbus/system_clock_client.h" |
| 92 #include "chromeos/dbus/update_engine_client.h" | 94 #include "chromeos/dbus/update_engine_client.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 112 { "metronome", DBusClientBundle::METRONOME }, | 114 { "metronome", DBusClientBundle::METRONOME }, |
| 113 { "shill", DBusClientBundle::SHILL }, | 115 { "shill", DBusClientBundle::SHILL }, |
| 114 { "gsm_sms", DBusClientBundle::GSM_SMS }, | 116 { "gsm_sms", DBusClientBundle::GSM_SMS }, |
| 115 { "image_burner", DBusClientBundle::IMAGE_BURNER }, | 117 { "image_burner", DBusClientBundle::IMAGE_BURNER }, |
| 116 { "introspectable", DBusClientBundle::INTROSPECTABLE }, | 118 { "introspectable", DBusClientBundle::INTROSPECTABLE }, |
| 117 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, | 119 { "modem_messaging", DBusClientBundle::MODEM_MESSAGING }, |
| 118 { "nfc", DBusClientBundle::NFC }, | 120 { "nfc", DBusClientBundle::NFC }, |
| 119 { "peer_daemon", DBusClientBundle::PEER_DAEMON }, | 121 { "peer_daemon", DBusClientBundle::PEER_DAEMON }, |
| 120 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, | 122 { "permission_broker", DBusClientBundle::PERMISSION_BROKER }, |
| 121 { "power_manager", DBusClientBundle::POWER_MANAGER }, | 123 { "power_manager", DBusClientBundle::POWER_MANAGER }, |
| 124 { "privet_daemon", DBusClientBundle::PRIVET_DAEMON }, |
| 122 { "session_manager", DBusClientBundle::SESSION_MANAGER }, | 125 { "session_manager", DBusClientBundle::SESSION_MANAGER }, |
| 123 { "sms", DBusClientBundle::SMS }, | 126 { "sms", DBusClientBundle::SMS }, |
| 124 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, | 127 { "system_clock", DBusClientBundle::SYSTEM_CLOCK }, |
| 125 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, | 128 { "update_engine", DBusClientBundle::UPDATE_ENGINE }, |
| 126 }; | 129 }; |
| 127 | 130 |
| 128 // Parses single command line param value for dbus subsystem. If successful, | 131 // Parses single command line param value for dbus subsystem. If successful, |
| 129 // returns its enum representation. Otherwise returns NO_CLIENT. | 132 // returns its enum representation. Otherwise returns NO_CLIENT. |
| 130 DBusClientBundle::DBusClientType GetDBusClientType( | 133 DBusClientBundle::DBusClientType GetDBusClientType( |
| 131 const std::string& client_type_name) { | 134 const std::string& client_type_name) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 if (!IsUsingStub(PEER_DAEMON)) | 277 if (!IsUsingStub(PEER_DAEMON)) |
| 275 peer_daemon_manager_client_.reset(PeerDaemonManagerClient::Create()); | 278 peer_daemon_manager_client_.reset(PeerDaemonManagerClient::Create()); |
| 276 else | 279 else |
| 277 peer_daemon_manager_client_.reset(new FakePeerDaemonManagerClient); | 280 peer_daemon_manager_client_.reset(new FakePeerDaemonManagerClient); |
| 278 | 281 |
| 279 if (!IsUsingStub(PERMISSION_BROKER)) | 282 if (!IsUsingStub(PERMISSION_BROKER)) |
| 280 permission_broker_client_.reset(PermissionBrokerClient::Create()); | 283 permission_broker_client_.reset(PermissionBrokerClient::Create()); |
| 281 else | 284 else |
| 282 permission_broker_client_.reset(new FakePermissionBrokerClient); | 285 permission_broker_client_.reset(new FakePermissionBrokerClient); |
| 283 | 286 |
| 287 if (!IsUsingStub(PRIVET_DAEMON)) |
| 288 privet_daemon_manager_client_.reset(PrivetDaemonManagerClient::Create()); |
| 289 else |
| 290 privet_daemon_manager_client_.reset(new FakePrivetDaemonManagerClient); |
| 291 |
| 284 if (!IsUsingStub(LEADERSHIP_DAEMON)) { | 292 if (!IsUsingStub(LEADERSHIP_DAEMON)) { |
| 285 leadership_daemon_manager_client_.reset( | 293 leadership_daemon_manager_client_.reset( |
| 286 LeadershipDaemonManagerClient::Create()); | 294 LeadershipDaemonManagerClient::Create()); |
| 287 } else { | 295 } else { |
| 288 leadership_daemon_manager_client_.reset( | 296 leadership_daemon_manager_client_.reset( |
| 289 new FakeLeadershipDaemonManagerClient); | 297 new FakeLeadershipDaemonManagerClient); |
| 290 } | 298 } |
| 291 | 299 |
| 292 if (!IsUsingStub(AP_MANAGER)) | 300 if (!IsUsingStub(AP_MANAGER)) |
| 293 ap_manager_client_.reset(ApManagerClient::Create()); | 301 ap_manager_client_.reset(ApManagerClient::Create()); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 unstub_mask |= client; | 359 unstub_mask |= client; |
| 352 } else { | 360 } else { |
| 353 LOG(ERROR) << "Unknown dbus client: " << *iter; | 361 LOG(ERROR) << "Unknown dbus client: " << *iter; |
| 354 } | 362 } |
| 355 } | 363 } |
| 356 | 364 |
| 357 return unstub_mask; | 365 return unstub_mask; |
| 358 } | 366 } |
| 359 | 367 |
| 360 } // namespace chromeos | 368 } // namespace chromeos |
| OLD | NEW |