| 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 // Releases old IBusBus instance and creates new IBusBus instance and connects |
| 87 // to ibus-daemon with specified ibus address. If the specified address is |
| 88 // same as before, this function doesn't do anything. |
| 89 virtual void MaybeResetIBusBus(const std::string &ibus_address) = 0; |
| 90 |
| 84 // Returns the D-Bus system bus instance, owned by DBusThreadManager. | 91 // Returns the D-Bus system bus instance, owned by DBusThreadManager. |
| 85 virtual dbus::Bus* GetSystemBus() = 0; | 92 virtual dbus::Bus* GetSystemBus() = 0; |
| 86 | 93 |
| 94 // Returns the IBus bus instance, owned by DBusThreadManager. |
| 95 virtual dbus::Bus* GetIBusBus() = 0; |
| 96 |
| 87 // Returns the bluetooth adapter client, owned by DBusThreadManager. | 97 // Returns the bluetooth adapter client, owned by DBusThreadManager. |
| 88 // Do not cache this pointer and use it after DBusThreadManager is shut | 98 // Do not cache this pointer and use it after DBusThreadManager is shut |
| 89 // down. | 99 // down. |
| 90 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; | 100 virtual BluetoothAdapterClient* GetBluetoothAdapterClient() = 0; |
| 91 | 101 |
| 92 // Returns the bluetooth device client, owned by DBusThreadManager. | 102 // Returns the bluetooth device client, owned by DBusThreadManager. |
| 93 // Do not cache this pointer and use it after DBusThreadManager is shut | 103 // Do not cache this pointer and use it after DBusThreadManager is shut |
| 94 // down. | 104 // down. |
| 95 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; | 105 virtual BluetoothDeviceClient* GetBluetoothDeviceClient() = 0; |
| 96 | 106 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 206 |
| 197 protected: | 207 protected: |
| 198 DBusThreadManager(); | 208 DBusThreadManager(); |
| 199 | 209 |
| 200 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 210 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
| 201 }; | 211 }; |
| 202 | 212 |
| 203 } // namespace chromeos | 213 } // namespace chromeos |
| 204 | 214 |
| 205 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 215 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |