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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 class FakeNfcManagerClient; | 32 class FakeNfcManagerClient; |
33 class FakeNfcTagClient; | 33 class FakeNfcTagClient; |
34 class FakePowerManagerClient; | 34 class FakePowerManagerClient; |
35 class FakeImageBurnerClient; | 35 class FakeImageBurnerClient; |
36 class FakeSessionManagerClient; | 36 class FakeSessionManagerClient; |
37 class FakeShillDeviceClient; | 37 class FakeShillDeviceClient; |
38 class FakeShillManagerClient; | 38 class FakeShillManagerClient; |
39 class FakeSystemClockClient; | 39 class FakeSystemClockClient; |
40 class FakeUpdateEngineClient; | 40 class FakeUpdateEngineClient; |
41 class MockIBusClient; | 41 class MockIBusClient; |
42 class MockIBusEngineFactoryService; | |
43 class MockIBusEngineService; | |
44 | 42 |
45 // This class provides a fake implementation of DBusThreadManager, which | 43 // This class provides a fake implementation of DBusThreadManager, which |
46 // hosts fake D-Bus clients. | 44 // hosts fake D-Bus clients. |
47 class FakeDBusThreadManager : public DBusThreadManager { | 45 class FakeDBusThreadManager : public DBusThreadManager { |
48 public: | 46 public: |
49 FakeDBusThreadManager(); | 47 FakeDBusThreadManager(); |
50 virtual ~FakeDBusThreadManager(); | 48 virtual ~FakeDBusThreadManager(); |
51 | 49 |
52 virtual void AddObserver(DBusThreadManagerObserver* observer) OVERRIDE; | 50 virtual void AddObserver(DBusThreadManagerObserver* observer) OVERRIDE; |
53 virtual void RemoveObserver(DBusThreadManagerObserver* observer) OVERRIDE; | 51 virtual void RemoveObserver(DBusThreadManagerObserver* observer) OVERRIDE; |
54 virtual void InitIBusBus(const std::string& ibus_address, | 52 virtual void InitIBusBus(const std::string& ibus_address, |
55 const base::Closure& closure) OVERRIDE; | 53 const base::Closure& closure) OVERRIDE; |
56 virtual dbus::Bus* GetSystemBus() OVERRIDE; | 54 virtual dbus::Bus* GetSystemBus() OVERRIDE; |
57 virtual dbus::Bus* GetIBusBus() OVERRIDE; | |
58 | 55 |
59 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE; | 56 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE; |
60 virtual BluetoothAgentManagerClient* | 57 virtual BluetoothAgentManagerClient* |
61 GetBluetoothAgentManagerClient() OVERRIDE; | 58 GetBluetoothAgentManagerClient() OVERRIDE; |
62 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() OVERRIDE; | 59 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() OVERRIDE; |
63 virtual BluetoothInputClient* GetBluetoothInputClient() OVERRIDE; | 60 virtual BluetoothInputClient* GetBluetoothInputClient() OVERRIDE; |
64 virtual BluetoothProfileManagerClient* | 61 virtual BluetoothProfileManagerClient* |
65 GetBluetoothProfileManagerClient() OVERRIDE; | 62 GetBluetoothProfileManagerClient() OVERRIDE; |
66 virtual CrasAudioClient* GetCrasAudioClient() OVERRIDE; | 63 virtual CrasAudioClient* GetCrasAudioClient() OVERRIDE; |
67 virtual CrosDisksClient* GetCrosDisksClient() OVERRIDE; | 64 virtual CrosDisksClient* GetCrosDisksClient() OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... |
81 virtual NfcManagerClient* GetNfcManagerClient() OVERRIDE; | 78 virtual NfcManagerClient* GetNfcManagerClient() OVERRIDE; |
82 virtual NfcTagClient* GetNfcTagClient() OVERRIDE; | 79 virtual NfcTagClient* GetNfcTagClient() OVERRIDE; |
83 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE; | 80 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE; |
84 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE; | 81 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE; |
85 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE; | 82 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE; |
86 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE; | 83 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE; |
87 virtual SMSClient* GetSMSClient() OVERRIDE; | 84 virtual SMSClient* GetSMSClient() OVERRIDE; |
88 virtual SystemClockClient* GetSystemClockClient() OVERRIDE; | 85 virtual SystemClockClient* GetSystemClockClient() OVERRIDE; |
89 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE; | 86 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE; |
90 virtual IBusClient* GetIBusClient() OVERRIDE; | 87 virtual IBusClient* GetIBusClient() OVERRIDE; |
91 virtual IBusEngineFactoryService* GetIBusEngineFactoryService() OVERRIDE; | |
92 virtual IBusEngineService* GetIBusEngineService( | |
93 const dbus::ObjectPath& object_path) OVERRIDE; | |
94 virtual void RemoveIBusEngineService( | |
95 const dbus::ObjectPath& object_path) OVERRIDE; | |
96 | 88 |
97 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client() { | 89 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client() { |
98 return fake_bluetooth_adapter_client_.get(); | 90 return fake_bluetooth_adapter_client_.get(); |
99 } | 91 } |
100 | 92 |
101 FakeBluetoothAgentManagerClient* fake_bluetooth_agent_manager_client() { | 93 FakeBluetoothAgentManagerClient* fake_bluetooth_agent_manager_client() { |
102 return fake_bluetooth_agent_manager_client_.get(); | 94 return fake_bluetooth_agent_manager_client_.get(); |
103 } | 95 } |
104 | 96 |
105 FakeBluetoothDeviceClient* fake_bluetooth_device_client() { | 97 FakeBluetoothDeviceClient* fake_bluetooth_device_client() { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 160 |
169 FakeUpdateEngineClient* fake_update_engine_client() { | 161 FakeUpdateEngineClient* fake_update_engine_client() { |
170 return fake_update_engine_client_.get(); | 162 return fake_update_engine_client_.get(); |
171 } | 163 } |
172 | 164 |
173 // TODO(komatsu): Remove IBus related code. crbug.com/275262 | 165 // TODO(komatsu): Remove IBus related code. crbug.com/275262 |
174 MockIBusClient* mock_ibus_client() { | 166 MockIBusClient* mock_ibus_client() { |
175 return mock_ibus_client_.get(); | 167 return mock_ibus_client_.get(); |
176 } | 168 } |
177 | 169 |
178 MockIBusEngineService* mock_ibus_engine_service() { | |
179 return mock_ibus_engine_service_.get(); | |
180 } | |
181 | |
182 MockIBusEngineFactoryService* mock_ibus_engine_factory_service() { | |
183 return mock_ibus_engine_factory_service_.get(); | |
184 } | |
185 | |
186 void set_ibus_bus(dbus::Bus* ibus_bus) { | 170 void set_ibus_bus(dbus::Bus* ibus_bus) { |
187 ibus_bus_ = ibus_bus; | 171 ibus_bus_ = ibus_bus; |
188 } | 172 } |
189 | 173 |
190 private: | 174 private: |
191 // Note: Keep this before other members so they can call AddObserver() in | 175 // Note: Keep this before other members so they can call AddObserver() in |
192 // their c'tors. | 176 // their c'tors. |
193 ObserverList<DBusThreadManagerObserver> observers_; | 177 ObserverList<DBusThreadManagerObserver> observers_; |
194 | 178 |
195 scoped_ptr<FakeBluetoothAdapterClient> fake_bluetooth_adapter_client_; | 179 scoped_ptr<FakeBluetoothAdapterClient> fake_bluetooth_adapter_client_; |
(...skipping 12 matching lines...) Expand all Loading... |
208 scoped_ptr<FakeNfcManagerClient> fake_nfc_manager_client_; | 192 scoped_ptr<FakeNfcManagerClient> fake_nfc_manager_client_; |
209 scoped_ptr<FakeNfcTagClient> fake_nfc_tag_client_; | 193 scoped_ptr<FakeNfcTagClient> fake_nfc_tag_client_; |
210 scoped_ptr<FakeSessionManagerClient> fake_session_manager_client_; | 194 scoped_ptr<FakeSessionManagerClient> fake_session_manager_client_; |
211 scoped_ptr<FakeShillDeviceClient> fake_shill_device_client_; | 195 scoped_ptr<FakeShillDeviceClient> fake_shill_device_client_; |
212 scoped_ptr<FakeShillManagerClient> fake_shill_manager_client_; | 196 scoped_ptr<FakeShillManagerClient> fake_shill_manager_client_; |
213 scoped_ptr<FakeSystemClockClient> fake_system_clock_client_; | 197 scoped_ptr<FakeSystemClockClient> fake_system_clock_client_; |
214 scoped_ptr<FakePowerManagerClient> fake_power_manager_client_; | 198 scoped_ptr<FakePowerManagerClient> fake_power_manager_client_; |
215 scoped_ptr<FakeUpdateEngineClient> fake_update_engine_client_; | 199 scoped_ptr<FakeUpdateEngineClient> fake_update_engine_client_; |
216 | 200 |
217 scoped_ptr<MockIBusClient> mock_ibus_client_; | 201 scoped_ptr<MockIBusClient> mock_ibus_client_; |
218 scoped_ptr<MockIBusEngineService> mock_ibus_engine_service_; | |
219 scoped_ptr<MockIBusEngineFactoryService> mock_ibus_engine_factory_service_; | |
220 | 202 |
221 scoped_ptr<PowerPolicyController> power_policy_controller_; | 203 scoped_ptr<PowerPolicyController> power_policy_controller_; |
222 dbus::Bus* ibus_bus_; | 204 dbus::Bus* ibus_bus_; |
223 | 205 |
224 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager); | 206 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager); |
225 }; | 207 }; |
226 | 208 |
227 } // namespace chromeos | 209 } // namespace chromeos |
228 | 210 |
229 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ | 211 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |