| 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 "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 5 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 6 | 6 |
| 7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
| 8 #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h" | 8 #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h" |
| 9 #include "chrome/browser/chromeos/dbus/bluetooth_device_client.h" | 9 #include "chrome/browser/chromeos/dbus/bluetooth_device_client.h" |
| 10 #include "chrome/browser/chromeos/dbus/bluetooth_input_client.h" | 10 #include "chrome/browser/chromeos/dbus/bluetooth_input_client.h" |
| 11 #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" | 11 #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" |
| 12 #include "chrome/browser/chromeos/dbus/bluetooth_node_client.h" | 12 #include "chrome/browser/chromeos/dbus/bluetooth_node_client.h" |
| 13 #include "chrome/browser/chromeos/dbus/cashew_client.h" | 13 #include "chrome/browser/chromeos/dbus/cashew_client.h" |
| 14 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" | |
| 15 #include "chrome/browser/chromeos/dbus/cros_disks_client.h" | 14 #include "chrome/browser/chromeos/dbus/cros_disks_client.h" |
| 16 #include "chrome/browser/chromeos/dbus/cryptohome_client.h" | 15 #include "chrome/browser/chromeos/dbus/cryptohome_client.h" |
| 17 #include "chrome/browser/chromeos/dbus/image_burner_client.h" | 16 #include "chrome/browser/chromeos/dbus/image_burner_client.h" |
| 18 #include "chrome/browser/chromeos/dbus/introspectable_client.h" | 17 #include "chrome/browser/chromeos/dbus/introspectable_client.h" |
| 19 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 18 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 20 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 19 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
| 21 #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h" | 20 #include "chrome/browser/chromeos/dbus/speech_synthesizer_client.h" |
| 22 #include "chrome/browser/chromeos/dbus/update_engine_client.h" | 21 #include "chrome/browser/chromeos/dbus/update_engine_client.h" |
| 23 #include "dbus/bus.h" | 22 #include "dbus/bus.h" |
| 24 | 23 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 dbus_thread_->StartWithOptions(thread_options); | 36 dbus_thread_->StartWithOptions(thread_options); |
| 38 | 37 |
| 39 // Create the connection to the system bus. | 38 // Create the connection to the system bus. |
| 40 dbus::Bus::Options system_bus_options; | 39 dbus::Bus::Options system_bus_options; |
| 41 system_bus_options.bus_type = dbus::Bus::SYSTEM; | 40 system_bus_options.bus_type = dbus::Bus::SYSTEM; |
| 42 system_bus_options.connection_type = dbus::Bus::PRIVATE; | 41 system_bus_options.connection_type = dbus::Bus::PRIVATE; |
| 43 system_bus_options.dbus_thread_message_loop_proxy = | 42 system_bus_options.dbus_thread_message_loop_proxy = |
| 44 dbus_thread_->message_loop_proxy(); | 43 dbus_thread_->message_loop_proxy(); |
| 45 system_bus_ = new dbus::Bus(system_bus_options); | 44 system_bus_ = new dbus::Bus(system_bus_options); |
| 46 | 45 |
| 47 // Create and start the cros D-Bus service. | |
| 48 cros_dbus_service_.reset(CrosDBusService::Create(system_bus_.get())); | |
| 49 cros_dbus_service_->Start(); | |
| 50 | |
| 51 // Create the bluetooth clients. | 46 // Create the bluetooth clients. |
| 52 bluetooth_manager_client_.reset(BluetoothManagerClient::Create( | 47 bluetooth_manager_client_.reset(BluetoothManagerClient::Create( |
| 53 system_bus_.get())); | 48 system_bus_.get())); |
| 54 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create( | 49 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create( |
| 55 system_bus_.get(), bluetooth_manager_client_.get())); | 50 system_bus_.get(), bluetooth_manager_client_.get())); |
| 56 bluetooth_device_client_.reset(BluetoothDeviceClient::Create( | 51 bluetooth_device_client_.reset(BluetoothDeviceClient::Create( |
| 57 system_bus_.get(), bluetooth_adapter_client_.get())); | 52 system_bus_.get(), bluetooth_adapter_client_.get())); |
| 58 bluetooth_input_client_.reset(BluetoothInputClient::Create( | 53 bluetooth_input_client_.reset(BluetoothInputClient::Create( |
| 59 system_bus_.get(), bluetooth_adapter_client_.get())); | 54 system_bus_.get(), bluetooth_adapter_client_.get())); |
| 60 bluetooth_node_client_.reset(BluetoothNodeClient::Create( | 55 bluetooth_node_client_.reset(BluetoothNodeClient::Create( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return speech_synthesizer_client_.get(); | 159 return speech_synthesizer_client_.get(); |
| 165 } | 160 } |
| 166 | 161 |
| 167 // DBusThreadManager override. | 162 // DBusThreadManager override. |
| 168 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE { | 163 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE { |
| 169 return update_engine_client_.get(); | 164 return update_engine_client_.get(); |
| 170 } | 165 } |
| 171 | 166 |
| 172 scoped_ptr<base::Thread> dbus_thread_; | 167 scoped_ptr<base::Thread> dbus_thread_; |
| 173 scoped_refptr<dbus::Bus> system_bus_; | 168 scoped_refptr<dbus::Bus> system_bus_; |
| 174 scoped_ptr<CrosDBusService> cros_dbus_service_; | |
| 175 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; | 169 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; |
| 176 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; | 170 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; |
| 177 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; | 171 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; |
| 178 scoped_ptr<BluetoothManagerClient> bluetooth_manager_client_; | 172 scoped_ptr<BluetoothManagerClient> bluetooth_manager_client_; |
| 179 scoped_ptr<BluetoothNodeClient> bluetooth_node_client_; | 173 scoped_ptr<BluetoothNodeClient> bluetooth_node_client_; |
| 180 scoped_ptr<CashewClient> cashew_client_; | 174 scoped_ptr<CashewClient> cashew_client_; |
| 181 scoped_ptr<CrosDisksClient> cros_disks_client_; | 175 scoped_ptr<CrosDisksClient> cros_disks_client_; |
| 182 scoped_ptr<CryptohomeClient> cryptohome_client_; | 176 scoped_ptr<CryptohomeClient> cryptohome_client_; |
| 183 scoped_ptr<ImageBurnerClient> image_burner_client_; | 177 scoped_ptr<ImageBurnerClient> image_burner_client_; |
| 184 scoped_ptr<IntrospectableClient> introspectable_client_; | 178 scoped_ptr<IntrospectableClient> introspectable_client_; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 222 } |
| 229 | 223 |
| 230 // static | 224 // static |
| 231 DBusThreadManager* DBusThreadManager::Get() { | 225 DBusThreadManager* DBusThreadManager::Get() { |
| 232 CHECK(g_dbus_thread_manager) | 226 CHECK(g_dbus_thread_manager) |
| 233 << "DBusThreadManager::Get() called before Initialize()"; | 227 << "DBusThreadManager::Get() called before Initialize()"; |
| 234 return g_dbus_thread_manager; | 228 return g_dbus_thread_manager; |
| 235 } | 229 } |
| 236 | 230 |
| 237 } // namespace chromeos | 231 } // namespace chromeos |
| OLD | NEW |