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

Unified Diff: chrome/browser/chromeos/input_method/ibus_controller_impl.h

Issue 10159004: Extends DBusThreadManager to connect ibus-bus. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Introduce IBusAddressWatcher class 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: chrome/browser/chromeos/input_method/ibus_controller_impl.h
diff --git a/chrome/browser/chromeos/input_method/ibus_controller_impl.h b/chrome/browser/chromeos/input_method/ibus_controller_impl.h
index 97de94269287b74c069f11cafb0199567b7852c4..42636de5a087977db52448375547b3432ad8fe52 100644
--- a/chrome/browser/chromeos/input_method/ibus_controller_impl.h
+++ b/chrome/browser/chromeos/input_method/ibus_controller_impl.h
@@ -60,7 +60,17 @@ class IBusControllerImpl : public IBusControllerBase {
const InputMethodProperty& new_prop,
InputMethodPropertyList* prop_list);
+ static void IBusDaemonInitializationDone(IBusControllerImpl* controller,
+ const std::string& ibus_address);
+
private:
+ enum IBusDaemonStatus{
+ IBUS_DAEMON_INITIALIZING,
+ IBUS_DAEMON_RUNNING,
+ IBUS_DAEMON_SHUTTING_DOWN,
+ IBUS_DAEMON_STOP,
+ };
+
// Functions that end with Thunk are used to deal with glib callbacks.
CHROMEG_CALLBACK_0(IBusControllerImpl, void, BusConnected, IBusBus*);
CHROMEG_CALLBACK_0(IBusControllerImpl, void, BusDisconnected, IBusBus*);
@@ -111,9 +121,11 @@ class IBusControllerImpl : public IBusControllerBase {
// "update-property" D-Bus signals from ibus-daemon.
void ConnectPanelServiceSignals();
- // Starts ibus-daemon if it's not yet started and |should_launch_daemon_| is
- // true.
- bool MaybeLaunchIBusDaemon();
+ // Adds address file watcher in FILE thread and then calls LaunchIBusDaemon.
+ bool StartIBusDaemon();
+
+ // Starts ibus-daemon.
+ void LaunchIBusDaemon(const std::string& ibus_address);
// Launches an input method procsess specified by the given command
// line. On success, returns true and stores the process handle in
@@ -139,9 +151,7 @@ class IBusControllerImpl : public IBusControllerBase {
// call ibus-daemon's API (e.g. activate input methods, set config, ...)
IBusBus* ibus_;
IBusConfig* ibus_config_;
-
- // true when ibus-daemon should be running.
- bool should_launch_daemon_;
+ std::string ibus_daemon_address_;
Yusuke Sato 2012/05/02 06:17:06 comment
Seigo Nonaka 2012/05/02 18:09:13 Done.
// The process handle of the IBus daemon. kNullProcessHandle if it's not
// running.
@@ -157,6 +167,12 @@ class IBusControllerImpl : public IBusControllerBase {
// An object which knows all valid input methods and layout IDs.
InputMethodWhitelist whitelist_;
+ // Represents ibus-daemon's status.
+ IBusDaemonStatus ibus_daemon_status_;
+
+ // Used for making callbacks for PostTask.
+ base::WeakPtrFactory<IBusControllerImpl> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(IBusControllerImpl);
};

Powered by Google App Engine
This is Rietveld 408576698