| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 79 |
| 78 // Initialize with stub implementations for tests based on stubs. | 80 // Initialize with stub implementations for tests based on stubs. |
| 79 static void InitializeWithStub(); | 81 static void InitializeWithStub(); |
| 80 | 82 |
| 81 // Destroys the global instance. | 83 // Destroys the global instance. |
| 82 static void Shutdown(); | 84 static void Shutdown(); |
| 83 | 85 |
| 84 // Gets the global instance. Initialize() must be called first. | 86 // Gets the global instance. Initialize() must be called first. |
| 85 static DBusThreadManager* Get(); | 87 static DBusThreadManager* Get(); |
| 86 | 88 |
| 89 // Creates new IBusBus instance to communicate with ibus-daemon with specified |
| 90 // ibus address. Must be called before using ibus related clients. |
| 91 // TODO(nona): Support shutdown to enable dynamical ibus-daemon shutdown. |
| 92 virtual void InitIBusBus(const std::string &ibus_address) = 0; |
| 93 |
| 87 // Returns the D-Bus system bus instance, owned by DBusThreadManager. | 94 // Returns the D-Bus system bus instance, owned by DBusThreadManager. |
| 88 virtual dbus::Bus* GetSystemBus() = 0; | 95 virtual dbus::Bus* GetSystemBus() = 0; |
| 89 | 96 |
| 97 // Returns the IBus bus instance, owned by DBusThreadManager. |
| 98 virtual dbus::Bus* GetIBusBus() = 0; |
| 99 |
| 90 // Returns the bluetooth adapter client, owned by DBusThreadManager. | 100 // Returns the bluetooth adapter client, owned by DBusThreadManager. |
| 91 // Do not cache this pointer and use it after DBusThreadManager is shut | 101 // Do not cache this pointer and use it after DBusThreadManager is shut |
| 92 // down. | 102 // down. |
| 93 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; | 103 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; |
| 94 | 104 |
| 95 // Returns the bluetooth device client, owned by DBusThreadManager. | 105 // Returns the bluetooth device client, owned by DBusThreadManager. |
| 96 // Do not cache this pointer and use it after DBusThreadManager is shut | 106 // Do not cache this pointer and use it after DBusThreadManager is shut |
| 97 // down. | 107 // down. |
| 98 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; | 108 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; |
| 99 | 109 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 209 |
| 200 protected: | 210 protected: |
| 201 DBusThreadManager(); | 211 DBusThreadManager(); |
| 202 | 212 |
| 203 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 213 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
| 204 }; | 214 }; |
| 205 | 215 |
| 206 } // namespace chromeos | 216 } // namespace chromeos |
| 207 | 217 |
| 208 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 218 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |