Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: chromeos/dbus/dbus_thread_manager.cc

Issue 10159004: Extends DBusThreadManager to connect ibus-bus. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply comments. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/mock_dbus_thread_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/dbus_thread_manager.cc
diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc
index 05ac8fd0635fbf4feb36ea0f06eed2f8f8a16d4e..fd7df99f46241996f79974d9c785db8124d7cf23 100644
--- a/chromeos/dbus/dbus_thread_manager.cc
+++ b/chromeos/dbus/dbus_thread_manager.cc
@@ -129,17 +129,38 @@ class DBusThreadManagerImpl : public DBusThreadManager {
// Shut down the bus. During the browser shutdown, it's ok to shut down
// the bus synchronously.
system_bus_->ShutdownOnDBusThreadAndBlock();
+ if (ibus_bus_.get())
+ ibus_bus_->ShutdownOnDBusThreadAndBlock();
// Stop the D-Bus thread.
dbus_thread_->Stop();
}
// DBusThreadManager override.
+ virtual void InitIBusBus(const std::string &ibus_address) OVERRIDE {
+ DCHECK(!ibus_bus_);
+ dbus::Bus::Options ibus_bus_options;
+ ibus_bus_options.bus_type = dbus::Bus::CUSTOM_ADDRESS;
+ ibus_bus_options.address = ibus_address;
+ ibus_bus_options.connection_type = dbus::Bus::PRIVATE;
+ ibus_bus_options.dbus_thread_message_loop_proxy =
+ dbus_thread_->message_loop_proxy();
+ ibus_bus_ = new dbus::Bus(ibus_bus_options);
+ ibus_address_ = ibus_address;
+ VLOG(1) << "Connected to ibus-daemon:" << ibus_address;
satorux1 2012/05/18 01:05:37 "Connected to ibus-daemon: "
Seigo Nonaka 2012/05/18 01:09:10 Done.
+ }
+
+ // DBusThreadManager override.
virtual dbus::Bus* GetSystemBus() OVERRIDE {
return system_bus_.get();
}
// DBusThreadManager override.
+ virtual dbus::Bus* GetIBusBus() OVERRIDE {
+ return ibus_bus_.get();
+ }
+
+ // DBusThreadManager override.
virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE {
return bluetooth_adapter_client_.get();
}
@@ -251,6 +272,7 @@ class DBusThreadManagerImpl : public DBusThreadManager {
scoped_ptr<base::Thread> dbus_thread_;
scoped_refptr<dbus::Bus> system_bus_;
+ scoped_refptr<dbus::Bus> ibus_bus_;
scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_;
scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_;
scoped_ptr<BluetoothInputClient> bluetooth_input_client_;
@@ -273,6 +295,8 @@ class DBusThreadManagerImpl : public DBusThreadManager {
scoped_ptr<SessionManagerClient> session_manager_client_;
scoped_ptr<SpeechSynthesizerClient> speech_synthesizer_client_;
scoped_ptr<UpdateEngineClient> update_engine_client_;
+
+ std::string ibus_address_;
};
// static
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.h ('k') | chromeos/dbus/mock_dbus_thread_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698