| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ | 6 #define CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/observer_list.h" | |
| 10 #include "chromeos/chromeos_export.h" | 9 #include "chromeos/chromeos_export.h" |
| 11 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
| 12 | 11 |
| 13 namespace dbus { | 12 namespace dbus { |
| 14 class Bus; | 13 class Bus; |
| 15 class ObjectPath; | 14 class ObjectPath; |
| 16 } // namespace dbus | 15 } // namespace dbus |
| 17 | 16 |
| 18 namespace chromeos { | 17 namespace chromeos { |
| 19 | 18 |
| 20 class DBusThreadManagerObserver; | |
| 21 | |
| 22 // This class provides a fake implementation of DBusThreadManager, which | 19 // This class provides a fake implementation of DBusThreadManager, which |
| 23 // hosts fake D-Bus clients. | 20 // hosts fake D-Bus clients. |
| 24 class CHROMEOS_EXPORT FakeDBusThreadManager : public DBusThreadManager { | 21 class CHROMEOS_EXPORT FakeDBusThreadManager : public DBusThreadManager { |
| 25 public: | 22 public: |
| 26 FakeDBusThreadManager(); | 23 FakeDBusThreadManager(); |
| 27 virtual ~FakeDBusThreadManager(); | 24 virtual ~FakeDBusThreadManager(); |
| 28 | 25 |
| 29 // Creates and sets all fake DBusClients and the PowerPolicyController. | 26 // Creates and sets all fake DBusClients and the PowerPolicyController. |
| 30 void SetFakeClients(); | 27 void SetFakeClients(); |
| 31 | 28 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void SetNfcRecordClient(scoped_ptr<NfcRecordClient> client); | 68 void SetNfcRecordClient(scoped_ptr<NfcRecordClient> client); |
| 72 void SetNfcTagClient(scoped_ptr<NfcTagClient> client); | 69 void SetNfcTagClient(scoped_ptr<NfcTagClient> client); |
| 73 void SetPermissionBrokerClient(scoped_ptr<PermissionBrokerClient> client); | 70 void SetPermissionBrokerClient(scoped_ptr<PermissionBrokerClient> client); |
| 74 void SetPowerManagerClient(scoped_ptr<PowerManagerClient> client); | 71 void SetPowerManagerClient(scoped_ptr<PowerManagerClient> client); |
| 75 void SetPowerPolicyController(scoped_ptr<PowerPolicyController> client); | 72 void SetPowerPolicyController(scoped_ptr<PowerPolicyController> client); |
| 76 void SetSessionManagerClient(scoped_ptr<SessionManagerClient> client); | 73 void SetSessionManagerClient(scoped_ptr<SessionManagerClient> client); |
| 77 void SetSMSClient(scoped_ptr<SMSClient> client); | 74 void SetSMSClient(scoped_ptr<SMSClient> client); |
| 78 void SetSystemClockClient(scoped_ptr<SystemClockClient> client); | 75 void SetSystemClockClient(scoped_ptr<SystemClockClient> client); |
| 79 void SetUpdateEngineClient(scoped_ptr<UpdateEngineClient> client); | 76 void SetUpdateEngineClient(scoped_ptr<UpdateEngineClient> client); |
| 80 | 77 |
| 81 virtual void AddObserver(DBusThreadManagerObserver* observer) OVERRIDE; | |
| 82 virtual void RemoveObserver(DBusThreadManagerObserver* observer) OVERRIDE; | |
| 83 virtual dbus::Bus* GetSystemBus() OVERRIDE; | 78 virtual dbus::Bus* GetSystemBus() OVERRIDE; |
| 84 | 79 |
| 85 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE; | 80 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE; |
| 86 virtual BluetoothAgentManagerClient* | 81 virtual BluetoothAgentManagerClient* |
| 87 GetBluetoothAgentManagerClient() OVERRIDE; | 82 GetBluetoothAgentManagerClient() OVERRIDE; |
| 88 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() OVERRIDE; | 83 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() OVERRIDE; |
| 89 virtual BluetoothGattCharacteristicClient* | 84 virtual BluetoothGattCharacteristicClient* |
| 90 GetBluetoothGattCharacteristicClient() OVERRIDE; | 85 GetBluetoothGattCharacteristicClient() OVERRIDE; |
| 91 virtual BluetoothGattDescriptorClient* | 86 virtual BluetoothGattDescriptorClient* |
| 92 GetBluetoothGattDescriptorClient() OVERRIDE; | 87 GetBluetoothGattDescriptorClient() OVERRIDE; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 117 virtual NfcTagClient* GetNfcTagClient() OVERRIDE; | 112 virtual NfcTagClient* GetNfcTagClient() OVERRIDE; |
| 118 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE; | 113 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE; |
| 119 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE; | 114 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE; |
| 120 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE; | 115 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE; |
| 121 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE; | 116 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE; |
| 122 virtual SMSClient* GetSMSClient() OVERRIDE; | 117 virtual SMSClient* GetSMSClient() OVERRIDE; |
| 123 virtual SystemClockClient* GetSystemClockClient() OVERRIDE; | 118 virtual SystemClockClient* GetSystemClockClient() OVERRIDE; |
| 124 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE; | 119 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE; |
| 125 | 120 |
| 126 private: | 121 private: |
| 127 // Note: Keep this before other members so they can call AddObserver() in | |
| 128 // their c'tors. | |
| 129 ObserverList<DBusThreadManagerObserver> observers_; | |
| 130 | |
| 131 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; | 122 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; |
| 132 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; | 123 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; |
| 133 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; | 124 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; |
| 134 scoped_ptr<BluetoothGattCharacteristicClient> | 125 scoped_ptr<BluetoothGattCharacteristicClient> |
| 135 bluetooth_gatt_characteristic_client_; | 126 bluetooth_gatt_characteristic_client_; |
| 136 scoped_ptr<BluetoothGattDescriptorClient> | 127 scoped_ptr<BluetoothGattDescriptorClient> |
| 137 bluetooth_gatt_descriptor_client_; | 128 bluetooth_gatt_descriptor_client_; |
| 138 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_; | 129 scoped_ptr<BluetoothGattManagerClient> bluetooth_gatt_manager_client_; |
| 139 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_; | 130 scoped_ptr<BluetoothGattServiceClient> bluetooth_gatt_service_client_; |
| 140 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; | 131 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 167 scoped_ptr<UpdateEngineClient> update_engine_client_; | 158 scoped_ptr<UpdateEngineClient> update_engine_client_; |
| 168 | 159 |
| 169 scoped_ptr<PowerPolicyController> power_policy_controller_; | 160 scoped_ptr<PowerPolicyController> power_policy_controller_; |
| 170 | 161 |
| 171 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager); | 162 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager); |
| 172 }; | 163 }; |
| 173 | 164 |
| 174 } // namespace chromeos | 165 } // namespace chromeos |
| 175 | 166 |
| 176 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ | 167 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |