| Index: chromeos_input_method.cc
|
| diff --git a/chromeos_input_method.cc b/chromeos_input_method.cc
|
| index 5bc2c1120593743d5c7c155a86021ae4a5f9d479..55a42d3256ec3817aab7d97b029ca799ba29d402 100644
|
| --- a/chromeos_input_method.cc
|
| +++ b/chromeos_input_method.cc
|
| @@ -460,6 +460,29 @@ class InputMethodStatusConnection {
|
| #endif
|
| }
|
|
|
| + // Called by cros API ChromeOSStopInputMethodProcess().
|
| + bool StopInputMethodProcess() {
|
| +#if IBUS_CHECK_VERSION(1, 3, 99)
|
| + if (!IBusConnectionIsAlive()) {
|
| + LOG(ERROR) << "StopInputMethodProcess: IBus connection is not alive";
|
| + return false;
|
| + }
|
| + ibus_bus_exit(ibus_, FALSE /* do not restart */);
|
| + if (ibus_config_) {
|
| + // Release |ibus_config_| to make sure next IBusConnectionIsAlive() call
|
| + // will return false.
|
| + g_object_unref(ibus_config_);
|
| + ibus_config_ = NULL;
|
| + }
|
| + return true;
|
| +#else
|
| + // For ibus-1.3, we don't implement the API and just return false since
|
| + // libcros's ibus-1.3 support will be removed soon. Chrome will use the
|
| + // kill system call to terminate the daemon.
|
| + return false;
|
| +#endif
|
| + }
|
| +
|
| // InputMethodType is used for GetInputMethods().
|
| enum InputMethodType {
|
| kActiveInputMethods, // Get active input methods.
|
| @@ -1631,6 +1654,12 @@ void ChromeOSDisconnectInputMethodStatus(
|
| }
|
|
|
| extern "C"
|
| +bool ChromeOSStopInputMethodProcess(InputMethodStatusConnection* connection) {
|
| + g_return_val_if_fail(connection, false);
|
| + return connection->StopInputMethodProcess();
|
| +}
|
| +
|
| +extern "C"
|
| InputMethodDescriptors* ChromeOSGetActiveInputMethods(
|
| InputMethodStatusConnection* connection) {
|
| g_return_val_if_fail(connection, NULL);
|
|
|