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

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: 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
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..df20e517c0fb82cd31f0c220d0368e8bbf4af302 100644
--- a/chromeos/dbus/dbus_thread_manager.cc
+++ b/chromeos/dbus/dbus_thread_manager.cc
@@ -23,6 +23,7 @@
#include "chromeos/dbus/flimflam_profile_client.h"
#include "chromeos/dbus/flimflam_service_client.h"
#include "chromeos/dbus/gsm_sms_client.h"
+#include "chromeos/dbus/ibus/ibus_util.h"
#include "chromeos/dbus/image_burner_client.h"
#include "chromeos/dbus/introspectable_client.h"
#include "chromeos/dbus/power_manager_client.h"
@@ -32,7 +33,6 @@
#include "dbus/bus.h"
namespace chromeos {
-
satorux1 2012/04/20 23:18:40 don't remove this.
Seigo Nonaka 2012/04/23 23:03:21 Done.
static DBusThreadManager* g_dbus_thread_manager = NULL;
// The DBusThreadManager implementation used in production.
@@ -53,6 +53,21 @@ class DBusThreadManagerImpl : public DBusThreadManager {
dbus_thread_->message_loop_proxy();
system_bus_ = new dbus::Bus(system_bus_options);
+ // Create the connection to the ibus bus.
+ std::string ibus_address;
+ if (IBusUtil::GetIBusAddress(&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 +151,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 +267,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_;

Powered by Google App Engine
This is Rietveld 408576698