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..097b07c6cddbc676ce26a893382b4cc369e671c8 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,13 @@ bool InputMethodWin::OnUntranslatedIMEMessage( |
InputMethod::NativeEventResult* result) { |
LRESULT original_result = 0; |
BOOL handled = FALSE; |
+ |
+ if (!default_input_language_initialized_) { |
+ default_input_language_initialized_ = true; |
msw
2015/03/27 19:05:23
Nix this, it's set in OnInputLocaleChanged().
ananta
2015/03/27 19:08:38
Done.
|
+ // Gets the initial input locale. |
msw
2015/03/27 19:05:23
Optionally nix comment and curlies, or outdent thi
ananta
2015/03/27 19:08:38
Done.
|
+ OnInputLocaleChanged(); |
+ } |
+ |
switch (event.message) { |
case WM_IME_SETCONTEXT: |
original_result = OnImeSetContext( |
@@ -179,6 +184,7 @@ void InputMethodWin::CancelComposition(const TextInputClient* client) { |
} |
void InputMethodWin::OnInputLocaleChanged() { |
+ default_input_language_initialized_ = true; |
active_ = imm32_manager_.SetInputLanguage(); |
locale_ = imm32_manager_.GetInputLanguageName(); |
OnInputMethodChanged(); |