| Index: chromeos/dbus/dbus_client_bundle.cc
|
| diff --git a/chromeos/dbus/dbus_client_bundle.cc b/chromeos/dbus/dbus_client_bundle.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f58488d6dc847efffef72bb5fbdcb224d8781570
|
| --- /dev/null
|
| +++ b/chromeos/dbus/dbus_client_bundle.cc
|
| @@ -0,0 +1,286 @@
|
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chromeos/dbus/dbus_client_bundle.h"
|
| +
|
| +#include "chromeos/dbus/bluetooth_adapter_client.h"
|
| +#include "chromeos/dbus/bluetooth_agent_manager_client.h"
|
| +#include "chromeos/dbus/bluetooth_device_client.h"
|
| +#include "chromeos/dbus/bluetooth_gatt_characteristic_client.h"
|
| +#include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
|
| +#include "chromeos/dbus/bluetooth_gatt_manager_client.h"
|
| +#include "chromeos/dbus/bluetooth_gatt_service_client.h"
|
| +#include "chromeos/dbus/bluetooth_input_client.h"
|
| +#include "chromeos/dbus/bluetooth_profile_manager_client.h"
|
| +#include "chromeos/dbus/cras_audio_client.h"
|
| +#include "chromeos/dbus/cros_disks_client.h"
|
| +#include "chromeos/dbus/cryptohome_client.h"
|
| +#include "chromeos/dbus/debug_daemon_client.h"
|
| +#include "chromeos/dbus/easy_unlock_client.h"
|
| +#include "chromeos/dbus/gsm_sms_client.h"
|
| +#include "chromeos/dbus/image_burner_client.h"
|
| +#include "chromeos/dbus/introspectable_client.h"
|
| +#include "chromeos/dbus/lorgnette_manager_client.h"
|
| +#include "chromeos/dbus/modem_messaging_client.h"
|
| +#include "chromeos/dbus/nfc_adapter_client.h"
|
| +#include "chromeos/dbus/nfc_device_client.h"
|
| +#include "chromeos/dbus/nfc_manager_client.h"
|
| +#include "chromeos/dbus/nfc_record_client.h"
|
| +#include "chromeos/dbus/nfc_tag_client.h"
|
| +#include "chromeos/dbus/permission_broker_client.h"
|
| +#include "chromeos/dbus/power_manager_client.h"
|
| +#include "chromeos/dbus/power_policy_controller.h"
|
| +#include "chromeos/dbus/session_manager_client.h"
|
| +#include "chromeos/dbus/shill_device_client.h"
|
| +#include "chromeos/dbus/shill_ipconfig_client.h"
|
| +#include "chromeos/dbus/shill_manager_client.h"
|
| +#include "chromeos/dbus/shill_profile_client.h"
|
| +#include "chromeos/dbus/shill_service_client.h"
|
| +#include "chromeos/dbus/sms_client.h"
|
| +#include "chromeos/dbus/system_clock_client.h"
|
| +#include "chromeos/dbus/update_engine_client.h"
|
| +
|
| +namespace chromeos {
|
| +
|
| +DBusClientBundle::DBusClientBundle(int client_mask) {
|
| + const DBusClientImplementationType type = REAL_DBUS_CLIENT_IMPLEMENTATION;
|
| +
|
| + if (client_mask & BLUETOOTH) {
|
| + bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create());
|
| + bluetooth_agent_manager_client_.reset(
|
| + BluetoothAgentManagerClient::Create());
|
| + bluetooth_device_client_.reset(BluetoothDeviceClient::Create());
|
| + bluetooth_input_client_.reset(BluetoothInputClient::Create());
|
| + bluetooth_profile_manager_client_.reset(
|
| + BluetoothProfileManagerClient::Create());
|
| + }
|
| +
|
| + if (client_mask & BLUETOOTH_LOW_ENERGY) {
|
| + bluetooth_gatt_characteristic_client_.reset(
|
| + BluetoothGattCharacteristicClient::Create());
|
| + bluetooth_gatt_descriptor_client_.reset(
|
| + BluetoothGattDescriptorClient::Create());
|
| + bluetooth_gatt_manager_client_.reset(
|
| + BluetoothGattManagerClient::Create());
|
| + bluetooth_gatt_service_client_.reset(
|
| + BluetoothGattServiceClient::Create());
|
| + }
|
| +
|
| + if (client_mask & CRAS)
|
| + cras_audio_client_.reset(CrasAudioClient::Create());
|
| +
|
| + if (client_mask & CROS_DISKS)
|
| + cros_disks_client_.reset(CrosDisksClient::Create(type));
|
| +
|
| + if (client_mask & CRYPTOHOME)
|
| + cryptohome_client_.reset(CryptohomeClient::Create());
|
| +
|
| + if (client_mask & DEBUG_DAEMON)
|
| + debug_daemon_client_.reset(DebugDaemonClient::Create());
|
| +
|
| + if (client_mask & EASY_UNLOCK)
|
| + easy_unlock_client_.reset(EasyUnlockClient::Create());
|
| +
|
| + if (client_mask & LORGNETTE_MANAGER)
|
| + lorgnette_manager_client_.reset(LorgnetteManagerClient::Create());
|
| +
|
| + if (client_mask & SHILL) {
|
| + shill_manager_client_.reset(ShillManagerClient::Create());
|
| + shill_device_client_.reset(ShillDeviceClient::Create());
|
| + shill_ipconfig_client_.reset(ShillIPConfigClient::Create());
|
| + shill_service_client_.reset(ShillServiceClient::Create());
|
| + shill_profile_client_.reset(ShillProfileClient::Create());
|
| + }
|
| +
|
| + if (client_mask & GSM_SMS)
|
| + gsm_sms_client_.reset(GsmSMSClient::Create());
|
| +
|
| + if (client_mask & IMAGE_BURNER)
|
| + image_burner_client_.reset(ImageBurnerClient::Create());
|
| +
|
| + if (client_mask & INTROSPECTABLE)
|
| + introspectable_client_.reset(IntrospectableClient::Create());
|
| +
|
| + if (client_mask & MODEM_MESSAGING)
|
| + modem_messaging_client_.reset(ModemMessagingClient::Create());
|
| +
|
| + // Create the NFC clients in the correct order based on their dependencies.
|
| + if (client_mask & NFC) {
|
| + nfc_manager_client_.reset(NfcManagerClient::Create());
|
| + nfc_adapter_client_.reset(
|
| + NfcAdapterClient::Create(nfc_manager_client_.get()));
|
| + nfc_device_client_.reset(
|
| + NfcDeviceClient::Create(nfc_adapter_client_.get()));
|
| + nfc_tag_client_.reset(NfcTagClient::Create(nfc_adapter_client_.get()));
|
| + nfc_record_client_.reset(NfcRecordClient::Create(nfc_device_client_.get(),
|
| + nfc_tag_client_.get()));
|
| + }
|
| +
|
| + if (client_mask & PERMISSION_BROKER)
|
| + permission_broker_client_.reset(PermissionBrokerClient::Create());
|
| +
|
| + if (client_mask & POWER_MANAGER)
|
| + power_manager_client_.reset(PowerManagerClient::Create(type));
|
| +
|
| + if (client_mask & SESSION_MANAGER)
|
| + session_manager_client_.reset(SessionManagerClient::Create(type));
|
| +
|
| + if (client_mask & SMS)
|
| + sms_client_.reset(SMSClient::Create());
|
| +
|
| + if (client_mask & SYSTEM_CLOCK)
|
| + system_clock_client_.reset(SystemClockClient::Create());
|
| +
|
| + if (client_mask & UPDATE_ENGINE)
|
| + update_engine_client_.reset(UpdateEngineClient::Create(type));
|
| +}
|
| +
|
| +DBusClientBundle::~DBusClientBundle() {
|
| +}
|
| +
|
| +BluetoothAdapterClient* DBusClientBundle::bluetooth_adapter_client() {
|
| + return bluetooth_adapter_client_.get();
|
| +}
|
| +
|
| +BluetoothAgentManagerClient*
|
| +DBusClientBundle::bluetooth_agent_manager_client() {
|
| + return bluetooth_agent_manager_client_.get();
|
| +}
|
| +
|
| +BluetoothDeviceClient* DBusClientBundle::bluetooth_device_client() {
|
| + return bluetooth_device_client_.get();
|
| +}
|
| +
|
| +BluetoothGattCharacteristicClient*
|
| +DBusClientBundle::bluetooth_gatt_characteristic_client() {
|
| + return bluetooth_gatt_characteristic_client_.get();
|
| +}
|
| +
|
| +BluetoothGattDescriptorClient*
|
| +DBusClientBundle::bluetooth_gatt_descriptor_client() {
|
| + return bluetooth_gatt_descriptor_client_.get();
|
| +
|
| +}
|
| +BluetoothGattManagerClient* DBusClientBundle::bluetooth_gatt_manager_client() {
|
| + return bluetooth_gatt_manager_client_.get();
|
| +}
|
| +
|
| +BluetoothGattServiceClient* DBusClientBundle::bluetooth_gatt_service_client() {
|
| + return bluetooth_gatt_service_client_.get();
|
| +}
|
| +
|
| +BluetoothInputClient* DBusClientBundle::bluetooth_input_client() {
|
| + return bluetooth_input_client_.get();
|
| +}
|
| +
|
| +BluetoothProfileManagerClient*
|
| +DBusClientBundle::bluetooth_profile_manager_client() {
|
| + return bluetooth_profile_manager_client_.get();
|
| +}
|
| +
|
| +CrasAudioClient* DBusClientBundle::cras_audio_client() {
|
| + return cras_audio_client_.get();
|
| +}
|
| +
|
| +CrosDisksClient* DBusClientBundle::cros_disks_client() {
|
| + return cros_disks_client_.get();
|
| +}
|
| +
|
| +CryptohomeClient* DBusClientBundle::cryptohome_client() {
|
| + return cryptohome_client_.get();
|
| +}
|
| +
|
| +DebugDaemonClient* DBusClientBundle::debug_daemon_client() {
|
| + return debug_daemon_client_.get();
|
| +}
|
| +
|
| +EasyUnlockClient* DBusClientBundle::easy_unlock_client() {
|
| + return easy_unlock_client_.get();
|
| +}
|
| +
|
| +LorgnetteManagerClient* DBusClientBundle::lorgnette_manager_client() {
|
| + return lorgnette_manager_client_.get();
|
| +}
|
| +
|
| +ShillDeviceClient* DBusClientBundle::shill_device_client() {
|
| + return shill_device_client_.get();
|
| +}
|
| +
|
| +ShillIPConfigClient* DBusClientBundle::shill_ipconfig_client() {
|
| + return shill_ipconfig_client_.get();
|
| +}
|
| +
|
| +ShillManagerClient* DBusClientBundle::shill_manager_client() {
|
| + return shill_manager_client_.get();
|
| +}
|
| +
|
| +ShillServiceClient* DBusClientBundle::shill_service_client() {
|
| + return shill_service_client_.get();
|
| +}
|
| +
|
| +ShillProfileClient* DBusClientBundle::shill_profile_client() {
|
| + return shill_profile_client_.get();
|
| +}
|
| +
|
| +GsmSMSClient* DBusClientBundle::gsm_sms_client() {
|
| + return gsm_sms_client_.get();
|
| +}
|
| +
|
| +ImageBurnerClient* DBusClientBundle::image_burner_client() {
|
| + return image_burner_client_.get();
|
| +}
|
| +
|
| +IntrospectableClient* DBusClientBundle::introspectable_client() {
|
| + return introspectable_client_.get();
|
| +}
|
| +
|
| +ModemMessagingClient* DBusClientBundle::modem_messaging_client() {
|
| + return modem_messaging_client_.get();
|
| +}
|
| +
|
| +NfcManagerClient* DBusClientBundle::nfc_manager_client() {
|
| + return nfc_manager_client_.get();
|
| +}
|
| +
|
| +NfcAdapterClient* DBusClientBundle::nfc_adapter_client() {
|
| + return nfc_adapter_client_.get();
|
| +}
|
| +
|
| +NfcDeviceClient* DBusClientBundle::nfc_device_client() {
|
| + return nfc_device_client_.get();
|
| +}
|
| +
|
| +NfcTagClient* DBusClientBundle::nfc_tag_client() {
|
| + return nfc_tag_client_.get();
|
| +}
|
| +
|
| +NfcRecordClient* DBusClientBundle::nfc_record_client() {
|
| + return nfc_record_client_.get();
|
| +}
|
| +
|
| +PermissionBrokerClient* DBusClientBundle::permission_broker_client() {
|
| + return permission_broker_client_.get();
|
| +}
|
| +
|
| +SystemClockClient* DBusClientBundle::system_clock_client() {
|
| + return system_clock_client_.get();
|
| +}
|
| +
|
| +PowerManagerClient* DBusClientBundle::power_manager_client() {
|
| + return power_manager_client_.get();
|
| +}
|
| +
|
| +SessionManagerClient* DBusClientBundle::session_manager_client() {
|
| + return session_manager_client_.get();
|
| +}
|
| +
|
| +SMSClient* DBusClientBundle::sms_client() {
|
| + return sms_client_.get();
|
| +}
|
| +
|
| +UpdateEngineClient* DBusClientBundle::update_engine_client() {
|
| + return update_engine_client_.get();
|
| +}
|
| +
|
| +} // namespace chromeos
|
|
|