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

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: Remove IBusUtil Created 8 years, 8 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 421c2cb0febeee93f0ed10a7d1df680c93204659..c2be8e0d326580eece417bc4178ebac0ac3de932 100644
--- a/chromeos/dbus/dbus_thread_manager.cc
+++ b/chromeos/dbus/dbus_thread_manager.cc
@@ -5,6 +5,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "base/chromeos/chromeos_version.h"
+#include "base/environment.h"
#include "base/threading/thread.h"
#include "chromeos/dbus/bluetooth_adapter_client.h"
#include "chromeos/dbus/bluetooth_device_client.h"
@@ -53,6 +54,22 @@ class DBusThreadManagerImpl : public DBusThreadManager {
dbus_thread_->message_loop_proxy();
system_bus_ = new dbus::Bus(system_bus_options);
+ // Create the connection to the ibus bus.
satorux1 2012/04/23 23:09:21 Is this the right place to connect to the ibus bus
Seigo Nonaka 2012/04/24 00:37:58 Ah yes! Done. On 2012/04/23 23:09:21, satorux1 w
+ std::string ibus_address;
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ if (env->GetVar("IBUS_ADDRESS", &ibus_address)) {
+ 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);
+ VLOG(1) << "Connected to ibus-daemon.(address:" << ibus_address << ")";
+ } else {
+ LOG(ERROR) << "Can not connect to ibus-daemon.";
+ }
+
// Determine whether we use stub or real client implementations.
const DBusClientImplementationType client_type =
base::chromeos::IsRunningOnChromeOS() ?
@@ -136,6 +153,11 @@ class DBusThreadManagerImpl : public DBusThreadManager {
}
// DBusThreadManager override.
+ virtual dbus::Bus* GetIBusBus() OVERRIDE {
+ return ibus_bus_.get();
+ }
+
+ // DBusThreadManager override.
virtual BluetoothAdapterClient* GetBluetoothAdapterClient() OVERRIDE {
return bluetooth_adapter_client_.get();
}
@@ -247,6 +269,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_;
« 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