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_DBUS_THREAD_MANAGER_H_ | 5 #ifndef CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
6 #define CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 6 #define CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 class BluetoothAgentManagerClient; | 30 class BluetoothAgentManagerClient; |
31 class BluetoothDeviceClient; | 31 class BluetoothDeviceClient; |
32 class BluetoothInputClient; | 32 class BluetoothInputClient; |
33 class BluetoothProfileManagerClient; | 33 class BluetoothProfileManagerClient; |
34 class CrasAudioClient; | 34 class CrasAudioClient; |
35 class CrosDisksClient; | 35 class CrosDisksClient; |
36 class CryptohomeClient; | 36 class CryptohomeClient; |
37 class DBusClient; | 37 class DBusClient; |
38 class DebugDaemonClient; | 38 class DebugDaemonClient; |
39 class GsmSMSClient; | 39 class GsmSMSClient; |
40 class IBusClient; | |
41 class IBusEngineFactoryService; | 40 class IBusEngineFactoryService; |
42 class IBusEngineService; | 41 class IBusEngineService; |
43 class ImageBurnerClient; | 42 class ImageBurnerClient; |
44 class IntrospectableClient; | 43 class IntrospectableClient; |
45 class ModemMessagingClient; | 44 class ModemMessagingClient; |
46 class NfcAdapterClient; | 45 class NfcAdapterClient; |
47 class NfcDeviceClient; | 46 class NfcDeviceClient; |
48 class NfcManagerClient; | 47 class NfcManagerClient; |
49 class NfcRecordClient; | 48 class NfcRecordClient; |
50 class NfcTagClient; | 49 class NfcTagClient; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // Destroys the global instance. | 101 // Destroys the global instance. |
103 static void Shutdown(); | 102 static void Shutdown(); |
104 | 103 |
105 // Gets the global instance. Initialize() must be called first. | 104 // Gets the global instance. Initialize() must be called first. |
106 static DBusThreadManager* Get(); | 105 static DBusThreadManager* Get(); |
107 | 106 |
108 // Adds or removes an observer. | 107 // Adds or removes an observer. |
109 virtual void AddObserver(DBusThreadManagerObserver* observer) = 0; | 108 virtual void AddObserver(DBusThreadManagerObserver* observer) = 0; |
110 virtual void RemoveObserver(DBusThreadManagerObserver* observer) = 0; | 109 virtual void RemoveObserver(DBusThreadManagerObserver* observer) = 0; |
111 | 110 |
112 // Creates new IBusBus instance to communicate with ibus-daemon with specified | |
113 // ibus address. |on_disconnected_callback| will be called when the connection | |
114 // with ibus-daemon is disconnected. Must be called before using ibus related | |
115 // clients. | |
116 // TODO(nona): Support shutdown to enable dynamical ibus-daemon shutdown. | |
117 virtual void InitIBusBus(const std::string& ibus_address, | |
118 const base::Closure& on_disconnected_callback) = 0; | |
119 | |
120 // Returns various D-Bus bus instances, owned by DBusThreadManager. | 111 // Returns various D-Bus bus instances, owned by DBusThreadManager. |
121 virtual dbus::Bus* GetSystemBus() = 0; | 112 virtual dbus::Bus* GetSystemBus() = 0; |
122 | 113 |
123 // All returned objects are owned by DBusThreadManager. Do not cache these | 114 // All returned objects are owned by DBusThreadManager. Do not cache these |
124 // pointers and use them after DBusThreadManager has been shut down. | 115 // pointers and use them after DBusThreadManager has been shut down. |
125 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; | 116 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; |
126 virtual BluetoothAgentManagerClient* GetBluetoothAgentManagerClient() = 0; | 117 virtual BluetoothAgentManagerClient* GetBluetoothAgentManagerClient() = 0; |
127 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; | 118 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; |
128 virtual BluetoothInputClient* GetBluetoothInputClient() = 0; | 119 virtual BluetoothInputClient* GetBluetoothInputClient() = 0; |
129 virtual BluetoothProfileManagerClient* GetBluetoothProfileManagerClient() = 0; | 120 virtual BluetoothProfileManagerClient* GetBluetoothProfileManagerClient() = 0; |
(...skipping 16 matching lines...) Expand all Loading... |
146 virtual SessionManagerClient* GetSessionManagerClient() = 0; | 137 virtual SessionManagerClient* GetSessionManagerClient() = 0; |
147 virtual ShillDeviceClient* GetShillDeviceClient() = 0; | 138 virtual ShillDeviceClient* GetShillDeviceClient() = 0; |
148 virtual ShillIPConfigClient* GetShillIPConfigClient() = 0; | 139 virtual ShillIPConfigClient* GetShillIPConfigClient() = 0; |
149 virtual ShillManagerClient* GetShillManagerClient() = 0; | 140 virtual ShillManagerClient* GetShillManagerClient() = 0; |
150 virtual ShillServiceClient* GetShillServiceClient() = 0; | 141 virtual ShillServiceClient* GetShillServiceClient() = 0; |
151 virtual ShillProfileClient* GetShillProfileClient() = 0; | 142 virtual ShillProfileClient* GetShillProfileClient() = 0; |
152 virtual SMSClient* GetSMSClient() = 0; | 143 virtual SMSClient* GetSMSClient() = 0; |
153 virtual SystemClockClient* GetSystemClockClient() = 0; | 144 virtual SystemClockClient* GetSystemClockClient() = 0; |
154 virtual UpdateEngineClient* GetUpdateEngineClient() = 0; | 145 virtual UpdateEngineClient* GetUpdateEngineClient() = 0; |
155 | 146 |
156 virtual IBusClient* GetIBusClient() = 0; | |
157 | |
158 virtual ~DBusThreadManager(); | 147 virtual ~DBusThreadManager(); |
159 | 148 |
160 protected: | 149 protected: |
161 DBusThreadManager(); | 150 DBusThreadManager(); |
162 | 151 |
163 private: | 152 private: |
164 // InitializeClients is called after g_dbus_thread_manager is set. | 153 // InitializeClients is called after g_dbus_thread_manager is set. |
165 // NOTE: Clients that access other clients in their Init() must be | 154 // NOTE: Clients that access other clients in their Init() must be |
166 // initialized in the correct order. | 155 // initialized in the correct order. |
167 static void InitializeClients(); | 156 static void InitializeClients(); |
168 | 157 |
169 // Initializes |client| with the |system_bus_|. | 158 // Initializes |client| with the |system_bus_|. |
170 static void InitClient(DBusClient* client); | 159 static void InitClient(DBusClient* client); |
171 | 160 |
172 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 161 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
173 }; | 162 }; |
174 | 163 |
175 } // namespace chromeos | 164 } // namespace chromeos |
176 | 165 |
177 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 166 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |