OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
9 #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h" | 9 #include "chrome/browser/chromeos/dbus/bluetooth_adapter_client.h" |
10 #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" | 10 #include "chrome/browser/chromeos/dbus/bluetooth_manager_client.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Create and start the cros D-Bus service. | 41 // Create and start the cros D-Bus service. |
42 cros_dbus_service_.reset(CrosDBusService::Create(system_bus_.get())); | 42 cros_dbus_service_.reset(CrosDBusService::Create(system_bus_.get())); |
43 cros_dbus_service_->Start(); | 43 cros_dbus_service_->Start(); |
44 | 44 |
45 // Start monitoring sensors if needed. | 45 // Start monitoring sensors if needed. |
46 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 46 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
47 if (command_line.HasSwitch(switches::kEnableSensors)) | 47 if (command_line.HasSwitch(switches::kEnableSensors)) |
48 sensors_client_.reset(SensorsClient::Create(system_bus_.get())); | 48 sensors_client_.reset(SensorsClient::Create(system_bus_.get())); |
49 | 49 |
50 // Create bluetooth clients if bluetooth is enabled. | 50 // Create the bluetooth clients. |
51 if (command_line.HasSwitch(switches::kEnableBluetooth)) { | 51 bluetooth_manager_client_.reset(BluetoothManagerClient::Create( |
52 bluetooth_manager_client_.reset(BluetoothManagerClient::Create( | 52 system_bus_.get())); |
53 system_bus_.get())); | 53 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create( |
54 bluetooth_adapter_client_.reset(BluetoothAdapterClient::Create( | 54 system_bus_.get())); |
55 system_bus_.get())); | |
56 } | |
57 | 55 |
58 // Create the power manager client. | 56 // Create the power manager client. |
59 power_manager_client_.reset(PowerManagerClient::Create(system_bus_.get())); | 57 power_manager_client_.reset(PowerManagerClient::Create(system_bus_.get())); |
60 // Create the session manager client. | 58 // Create the session manager client. |
61 session_manager_client_.reset( | 59 session_manager_client_.reset( |
62 SessionManagerClient::Create(system_bus_.get())); | 60 SessionManagerClient::Create(system_bus_.get())); |
63 // Create the speech synthesizer client. | 61 // Create the speech synthesizer client. |
64 speech_synthesizer_client_.reset( | 62 speech_synthesizer_client_.reset( |
65 SpeechSynthesizerClient::Create(system_bus_.get())); | 63 SpeechSynthesizerClient::Create(system_bus_.get())); |
66 } | 64 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 153 } |
156 | 154 |
157 // static | 155 // static |
158 DBusThreadManager* DBusThreadManager::Get() { | 156 DBusThreadManager* DBusThreadManager::Get() { |
159 CHECK(g_dbus_thread_manager) | 157 CHECK(g_dbus_thread_manager) |
160 << "DBusThreadManager::Get() called before Initialize()"; | 158 << "DBusThreadManager::Get() called before Initialize()"; |
161 return g_dbus_thread_manager; | 159 return g_dbus_thread_manager; |
162 } | 160 } |
163 | 161 |
164 } // namespace chromeos | 162 } // namespace chromeos |
OLD | NEW |