Chromium Code Reviews| Index: chrome/browser/chromeos/input_method/input_method_manager.cc |
| diff --git a/chrome/browser/chromeos/input_method/input_method_manager.cc b/chrome/browser/chromeos/input_method/input_method_manager.cc |
| index 1852c3326df4a91a01dea9ada5cf59ecf3f2fab0..31fe49158881b24a6826b19c98ae7abac8077c4f 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_manager.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_manager.cc |
| @@ -75,6 +75,7 @@ class InputMethodManagerImpl : public InputMethodManager, |
| #if !defined(TOUCH_UI) |
| candidate_window_controller_(NULL), |
| #endif |
| + shutting_down_(false), |
| ibus_daemon_process_handle_(base::kNullProcessHandle) { |
| // Observe APP_TERMINATING to stop input method daemon gracefully. |
| // We should not use APP_EXITING here since logout might be canceled by |
| @@ -832,6 +833,11 @@ class InputMethodManagerImpl : public InputMethodManager, |
| return false; |
| } |
| + if (shutting_down_) { |
| + LOG(ERROR) << "Trying to launch input method while shutting down"; |
|
Daniel Erat
2011/08/25 14:08:19
nit: change this to a NOTREACHED() so we'll crash
|
| + return false; |
| + } |
| + |
| #if !defined(TOUCH_UI) |
| if (!candidate_window_controller_.get()) { |
| candidate_window_controller_.reset( |
| @@ -904,6 +910,7 @@ class InputMethodManagerImpl : public InputMethodManager, |
| const NotificationDetails& details) { |
| // Stop the input method daemon on browser shutdown. |
| if (type == content::NOTIFICATION_APP_TERMINATING) { |
| + shutting_down_ = true; |
| notification_registrar_.RemoveAll(); |
| StopInputMethodDaemon(); |
| #if !defined(TOUCH_UI) |
| @@ -966,6 +973,9 @@ class InputMethodManagerImpl : public InputMethodManager, |
| candidate_window_controller_; |
| #endif |
| + // True if we've received the APP_TERMINATING notification. |
| + bool shutting_down_; |
| + |
| // The process handle of the IBus daemon. kNullProcessHandle if it's not |
| // running. |
| base::ProcessHandle ibus_daemon_process_handle_; |