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 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
12 | 14 |
13 namespace base { | 15 namespace base { |
14 class Thread; | 16 class Thread; |
15 }; | 17 }; |
16 | 18 |
17 namespace dbus { | 19 namespace dbus { |
18 class Bus; | 20 class Bus; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // The injected object will be owned by the internal pointer and deleted | 76 // The injected object will be owned by the internal pointer and deleted |
75 // by Shutdown(). | 77 // by Shutdown(). |
76 static void InitializeForTesting(DBusThreadManager* dbus_thread_manager); | 78 static void InitializeForTesting(DBusThreadManager* dbus_thread_manager); |
77 | 79 |
78 // Destroys the global instance. | 80 // Destroys the global instance. |
79 static void Shutdown(); | 81 static void Shutdown(); |
80 | 82 |
81 // Gets the global instance. Initialize() must be called first. | 83 // Gets the global instance. Initialize() must be called first. |
82 static DBusThreadManager* Get(); | 84 static DBusThreadManager* Get(); |
83 | 85 |
| 86 // Creates IBusBus instance and connect to ibus-daemon with specified ibus |
| 87 // address. This function must be called once. |
| 88 virtual void InitializeIBusBus(const std::string &ibus_address) = 0; |
| 89 |
84 // Returns the D-Bus system bus instance, owned by DBusThreadManager. | 90 // Returns the D-Bus system bus instance, owned by DBusThreadManager. |
85 virtual dbus::Bus* GetSystemBus() = 0; | 91 virtual dbus::Bus* GetSystemBus() = 0; |
86 | 92 |
| 93 // Returns the IBus bus instance, owned by DBusThreadManager. |
| 94 virtual dbus::Bus* GetIBusBus() = 0; |
| 95 |
87 // Returns the bluetooth adapter client, owned by DBusThreadManager. | 96 // Returns the bluetooth adapter client, owned by DBusThreadManager. |
88 // Do not cache this pointer and use it after DBusThreadManager is shut | 97 // Do not cache this pointer and use it after DBusThreadManager is shut |
89 // down. | 98 // down. |
90 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; | 99 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; |
91 | 100 |
92 // Returns the bluetooth device client, owned by DBusThreadManager. | 101 // Returns the bluetooth device client, owned by DBusThreadManager. |
93 // Do not cache this pointer and use it after DBusThreadManager is shut | 102 // Do not cache this pointer and use it after DBusThreadManager is shut |
94 // down. | 103 // down. |
95 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; | 104 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; |
96 | 105 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 205 |
197 protected: | 206 protected: |
198 DBusThreadManager(); | 207 DBusThreadManager(); |
199 | 208 |
200 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 209 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
201 }; | 210 }; |
202 | 211 |
203 } // namespace chromeos | 212 } // namespace chromeos |
204 | 213 |
205 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 214 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |