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 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 5 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chromeos/chromeos_switches.h" | 8 #include "chromeos/chromeos_switches.h" |
9 #include "chromeos/dbus/cras_audio_client_stub_impl.h" | 9 #include "chromeos/dbus/cras_audio_client_stub_impl.h" |
10 #include "chromeos/dbus/cros_disks_client.h" | 10 #include "chromeos/dbus/cros_disks_client.h" |
11 #include "chromeos/dbus/dbus_client.h" | 11 #include "chromeos/dbus/dbus_client.h" |
12 #include "chromeos/dbus/dbus_thread_manager.h" | 12 #include "chromeos/dbus/dbus_thread_manager.h" |
13 #include "chromeos/dbus/dbus_thread_manager_observer.h" | |
14 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 13 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
15 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" | 14 #include "chromeos/dbus/fake_bluetooth_agent_manager_client.h" |
16 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 15 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
17 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" | 16 #include "chromeos/dbus/fake_bluetooth_gatt_characteristic_client.h" |
18 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" | 17 #include "chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h" |
19 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" | 18 #include "chromeos/dbus/fake_bluetooth_gatt_manager_client.h" |
20 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" | 19 #include "chromeos/dbus/fake_bluetooth_gatt_service_client.h" |
21 #include "chromeos/dbus/fake_bluetooth_input_client.h" | 20 #include "chromeos/dbus/fake_bluetooth_input_client.h" |
22 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" | 21 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h" |
23 #include "chromeos/dbus/fake_cryptohome_client.h" | 22 #include "chromeos/dbus/fake_cryptohome_client.h" |
(...skipping 21 matching lines...) Expand all Loading... |
45 #include "chromeos/dbus/power_policy_controller.h" | 44 #include "chromeos/dbus/power_policy_controller.h" |
46 #include "chromeos/dbus/session_manager_client.h" | 45 #include "chromeos/dbus/session_manager_client.h" |
47 #include "chromeos/dbus/update_engine_client.h" | 46 #include "chromeos/dbus/update_engine_client.h" |
48 | 47 |
49 namespace chromeos { | 48 namespace chromeos { |
50 | 49 |
51 FakeDBusThreadManager::FakeDBusThreadManager() { | 50 FakeDBusThreadManager::FakeDBusThreadManager() { |
52 } | 51 } |
53 | 52 |
54 FakeDBusThreadManager::~FakeDBusThreadManager() { | 53 FakeDBusThreadManager::~FakeDBusThreadManager() { |
55 FOR_EACH_OBSERVER(DBusThreadManagerObserver, observers_, | |
56 OnDBusThreadManagerDestroying(this)); | |
57 } | 54 } |
58 | 55 |
59 void FakeDBusThreadManager::SetFakeClients() { | 56 void FakeDBusThreadManager::SetFakeClients() { |
60 const DBusClientImplementationType client_type = | 57 const DBusClientImplementationType client_type = |
61 STUB_DBUS_CLIENT_IMPLEMENTATION; | 58 STUB_DBUS_CLIENT_IMPLEMENTATION; |
62 SetBluetoothAdapterClient( | 59 SetBluetoothAdapterClient( |
63 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); | 60 scoped_ptr<BluetoothAdapterClient>(new FakeBluetoothAdapterClient)); |
64 SetBluetoothAgentManagerClient(scoped_ptr<BluetoothAgentManagerClient>( | 61 SetBluetoothAgentManagerClient(scoped_ptr<BluetoothAgentManagerClient>( |
65 new FakeBluetoothAgentManagerClient)); | 62 new FakeBluetoothAgentManagerClient)); |
66 SetBluetoothDeviceClient( | 63 SetBluetoothDeviceClient( |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 void FakeDBusThreadManager::SetSystemClockClient( | 309 void FakeDBusThreadManager::SetSystemClockClient( |
313 scoped_ptr<SystemClockClient> client) { | 310 scoped_ptr<SystemClockClient> client) { |
314 system_clock_client_ = client.Pass(); | 311 system_clock_client_ = client.Pass(); |
315 } | 312 } |
316 | 313 |
317 void FakeDBusThreadManager::SetUpdateEngineClient( | 314 void FakeDBusThreadManager::SetUpdateEngineClient( |
318 scoped_ptr<UpdateEngineClient> client) { | 315 scoped_ptr<UpdateEngineClient> client) { |
319 update_engine_client_ = client.Pass(); | 316 update_engine_client_ = client.Pass(); |
320 } | 317 } |
321 | 318 |
322 void FakeDBusThreadManager::AddObserver(DBusThreadManagerObserver* observer) { | |
323 DCHECK(observer); | |
324 observers_.AddObserver(observer); | |
325 } | |
326 | |
327 void FakeDBusThreadManager::RemoveObserver( | |
328 DBusThreadManagerObserver* observer) { | |
329 DCHECK(observer); | |
330 observers_.RemoveObserver(observer); | |
331 } | |
332 | |
333 dbus::Bus* FakeDBusThreadManager::GetSystemBus() { | 319 dbus::Bus* FakeDBusThreadManager::GetSystemBus() { |
334 return NULL; | 320 return NULL; |
335 } | 321 } |
336 | 322 |
337 BluetoothAdapterClient* FakeDBusThreadManager::GetBluetoothAdapterClient() { | 323 BluetoothAdapterClient* FakeDBusThreadManager::GetBluetoothAdapterClient() { |
338 return bluetooth_adapter_client_.get(); | 324 return bluetooth_adapter_client_.get(); |
339 } | 325 } |
340 | 326 |
341 BluetoothAgentManagerClient* | 327 BluetoothAgentManagerClient* |
342 FakeDBusThreadManager::GetBluetoothAgentManagerClient() { | 328 FakeDBusThreadManager::GetBluetoothAgentManagerClient() { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 463 |
478 SystemClockClient* FakeDBusThreadManager::GetSystemClockClient() { | 464 SystemClockClient* FakeDBusThreadManager::GetSystemClockClient() { |
479 return system_clock_client_.get(); | 465 return system_clock_client_.get(); |
480 } | 466 } |
481 | 467 |
482 UpdateEngineClient* FakeDBusThreadManager::GetUpdateEngineClient() { | 468 UpdateEngineClient* FakeDBusThreadManager::GetUpdateEngineClient() { |
483 return update_engine_client_.get(); | 469 return update_engine_client_.get(); |
484 } | 470 } |
485 | 471 |
486 } // namespace chromeos | 472 } // namespace chromeos |
OLD | NEW |