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 77ade8700138cfc4e765656bf3ec83905048f0a5..9887c49ae77e791796bfbff2c6e3e962cc66a7ed 100644 |
--- a/chrome/browser/chromeos/input_method/input_method_manager.cc |
+++ b/chrome/browser/chromeos/input_method/input_method_manager.cc |
@@ -17,6 +17,7 @@ |
#include "base/string_util.h" |
#include "base/stringprintf.h" |
#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/chromeos/input_method/browser_state_monitor.h" |
#include "chrome/browser/chromeos/input_method/input_method_util.h" |
#include "chrome/browser/chromeos/input_method/input_method_whitelist.h" |
#include "chrome/browser/chromeos/input_method/virtual_keyboard_selector.h" |
@@ -84,6 +85,8 @@ class InputMethodManagerImpl : public InputMethodManager, |
ibus_daemon_process_handle_(base::kNullProcessHandle), |
util_(whitelist_.GetSupportedInputMethods()), |
xkeyboard_(XKeyboard::Create(util_)), |
+ ALLOW_THIS_IN_INITIALIZER_LIST( |
+ browser_state_monitor_(new BrowserStateMonitor(this))), |
ignore_hotkeys_(false) { |
// Observe APP_TERMINATING to stop input method daemon gracefully. |
// We should not use APP_EXITING here since logout might be canceled by |
@@ -1211,6 +1214,9 @@ class InputMethodManagerImpl : public InputMethodManager, |
candidate_window_controller_->RemoveObserver(this); |
candidate_window_controller_.reset(NULL); |
#endif |
+ // |browser_state_monitor_| has to be destructed while the PrefService |
+ // object associated with the monitor is alive. (crbug.com/120183) |
+ browser_state_monitor_.reset(); |
} |
} |
@@ -1298,6 +1304,10 @@ class InputMethodManagerImpl : public InputMethodManager, |
// auto-repeat interval. |
scoped_ptr<XKeyboard> xkeyboard_; |
+ // An object which monitors a notification from the browser to keep track of |
+ // the browser state (not logged in, logged in, etc.). |
+ scoped_ptr<BrowserStateMonitor> browser_state_monitor_; |
+ |
// true when DisableHotkeys() is called to temporarily disable IME hotkeys. |
// EnableHotkeys() resets the flag to the default value, false. |
bool ignore_hotkeys_; |