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

Unified Diff: ui/base/ime/input_method_win.cc

Issue 1037103004: Fix a crash seen in Desktop Chrome Windows while displaying a bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 9 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
« no previous file with comments | « ui/base/ime/input_method_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_win.cc
diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc
index 0e2e89cff28fd52b15f8b6a2795787b9ff6d3bb4..69616839b92c249f64fef0d11af8f935050bc75e 100644
--- a/ui/base/ime/input_method_win.cc
+++ b/ui/base/ime/input_method_win.cc
@@ -32,7 +32,8 @@ InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate,
active_(false),
enabled_(false),
is_candidate_popup_open_(false),
- composing_window_handle_(NULL) {
+ composing_window_handle_(NULL),
+ default_input_language_initialized_(false) {
SetDelegate(delegate);
// In non-Aura environment, appropriate callbacks to OnFocus() and OnBlur()
// are not implemented yet. To work around this limitation, here we use
@@ -43,9 +44,6 @@ InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate,
}
void InputMethodWin::Init(bool focused) {
- // Gets the initial input locale.
- OnInputLocaleChanged();
-
InputMethodBase::Init(focused);
}
@@ -66,6 +64,12 @@ bool InputMethodWin::OnUntranslatedIMEMessage(
InputMethod::NativeEventResult* result) {
LRESULT original_result = 0;
BOOL handled = FALSE;
+
+ if (!default_input_language_initialized_) {
+ // Gets the initial input locale.
+ OnInputLocaleChanged();
+ }
+
switch (event.message) {
case WM_IME_SETCONTEXT:
original_result = OnImeSetContext(
@@ -179,6 +183,7 @@ void InputMethodWin::CancelComposition(const TextInputClient* client) {
}
void InputMethodWin::OnInputLocaleChanged() {
+ default_input_language_initialized_ = true;
active_ = imm32_manager_.SetInputLanguage();
locale_ = imm32_manager_.GetInputLanguageName();
OnInputMethodChanged();
« no previous file with comments | « ui/base/ime/input_method_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698