Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/cros/input_method_library.h" | 5 #include "chrome/browser/chromeos/cros/input_method_library.h" |
| 6 | 6 |
| 7 #include <glib.h> | 7 #include <glib.h> |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 | 9 |
| 10 #include "unicode/uloc.h" | 10 #include "unicode/uloc.h" |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 571 void StopInputMethodProcesses() { | 571 void StopInputMethodProcesses() { |
| 572 should_launch_ime_ = false; | 572 should_launch_ime_ = false; |
| 573 if (ibus_daemon_process_id_) { | 573 if (ibus_daemon_process_id_) { |
| 574 const std::string xkb_engine_name = | 574 const std::string xkb_engine_name = |
| 575 chromeos::GetHardwareKeyboardLayoutName(); | 575 chromeos::GetHardwareKeyboardLayoutName(); |
| 576 // We should not use chromeos::ChangeInputMethod() here since without the | 576 // We should not use chromeos::ChangeInputMethod() here since without the |
| 577 // ibus-daemon process, ChangeCurrentInputMethod() callback function which | 577 // ibus-daemon process, ChangeCurrentInputMethod() callback function which |
| 578 // actually changes the XKB layout will not be called. | 578 // actually changes the XKB layout will not be called. |
| 579 CrosLibrary::Get()->GetKeyboardLibrary()->SetCurrentKeyboardLayoutByName( | 579 CrosLibrary::Get()->GetKeyboardLibrary()->SetCurrentKeyboardLayoutByName( |
| 580 chromeos::input_method::GetKeyboardLayoutName(xkb_engine_name)); | 580 chromeos::input_method::GetKeyboardLayoutName(xkb_engine_name)); |
| 581 kill(ibus_daemon_process_id_, SIGTERM); | 581 if (!chromeos::StopInputMethodProcess(input_method_status_connection_)) { |
| 582 LOG(ERROR) << "StopInputMethodProcess IPC failed. Sending SIGTERM to " | |
| 583 << "PID " << ibus_daemon_process_id_; | |
| 584 kill(ibus_daemon_process_id_, SIGTERM); | |
| 585 } | |
| 586 LOG(INFO) << "ibus-daemon (PID=" << ibus_daemon_process_id_ << ") is " | |
|
satorux1
2011/01/11 07:02:30
Use of LOG(INFO) is discouraged. VLOG(1) would be
Yusuke Sato
2011/01/11 07:51:01
Done.
| |
| 587 << "terminated"; | |
| 582 ibus_daemon_process_id_ = 0; | 588 ibus_daemon_process_id_ = 0; |
| 583 } | 589 } |
| 584 if (candidate_window_process_id_) { | 590 if (candidate_window_process_id_) { |
| 585 kill(candidate_window_process_id_, SIGTERM); | 591 kill(candidate_window_process_id_, SIGTERM); |
| 592 LOG(INFO) << "candidate_window (PID=" << candidate_window_process_id_ | |
|
satorux1
2011/01/11 07:02:30
ditto
Yusuke Sato
2011/01/11 07:51:01
Done.
| |
| 593 << ") is terminated"; | |
| 586 candidate_window_process_id_ = 0; | 594 candidate_window_process_id_ = 0; |
| 587 } | 595 } |
| 588 } | 596 } |
| 589 | 597 |
| 590 void SetDeferImeStartup(bool defer) { | 598 void SetDeferImeStartup(bool defer) { |
| 591 VLOG(1) << "Setting DeferImeStartup to " << defer; | 599 VLOG(1) << "Setting DeferImeStartup to " << defer; |
| 592 defer_ime_startup_ = defer; | 600 defer_ime_startup_ = defer; |
| 593 } | 601 } |
| 594 | 602 |
| 595 void SetEnableAutoImeShutdown(bool enable) { | 603 void SetEnableAutoImeShutdown(bool enable) { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 870 return new InputMethodLibraryStubImpl(); | 878 return new InputMethodLibraryStubImpl(); |
| 871 else | 879 else |
| 872 return new InputMethodLibraryImpl(); | 880 return new InputMethodLibraryImpl(); |
| 873 } | 881 } |
| 874 | 882 |
| 875 } // namespace chromeos | 883 } // namespace chromeos |
| 876 | 884 |
| 877 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 885 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
| 878 // won't be deleted until it's last InvokeLater is run. | 886 // won't be deleted until it's last InvokeLater is run. |
| 879 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::InputMethodLibraryImpl); | 887 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::InputMethodLibraryImpl); |
| OLD | NEW |