Index: ui/base/ime/input_method_imm32.cc |
diff --git a/ui/base/ime/input_method_imm32.cc b/ui/base/ime/input_method_imm32.cc |
old mode 100644 |
new mode 100755 |
index 034ea1722570055aacefeff7da0d05376f215781..625f41b221513613cc1dd080e437002168421da5 |
--- a/ui/base/ime/input_method_imm32.cc |
+++ b/ui/base/ime/input_method_imm32.cc |
@@ -14,7 +14,7 @@ namespace ui { |
InputMethodIMM32::InputMethodIMM32(internal::InputMethodDelegate* delegate, |
HWND toplevel_window_handle) |
: InputMethodWin(delegate, toplevel_window_handle), |
- enabled_(false), |
+ enabled_(false), is_candidate_popup_open_(false), |
composing_window_handle_(NULL) { |
// In non-Aura environment, appropriate callbacks to OnFocus() and OnBlur() |
// are not implemented yet. To work around this limitation, here we use |
@@ -71,6 +71,10 @@ bool InputMethodIMM32::OnUntranslatedIMEMessage( |
original_result = OnDeadChar( |
event.message, event.wParam, event.lParam, &handled); |
break; |
+ case WM_IME_NOTIFY: |
+ original_result = OnImeNotify( |
+ event.message, event.wParam, event.lParam, &handled); |
+ break; |
default: |
NOTREACHED() << "Unknown IME message:" << event.message; |
break; |
@@ -121,6 +125,10 @@ void InputMethodIMM32::SetFocusedTextInputClient(TextInputClient* client) { |
InputMethodWin::SetFocusedTextInputClient(client); |
} |
+bool InputMethodIMM32::IsCandidatePopupOpen() const { |
+ return is_candidate_popup_open_; |
+} |
+ |
void InputMethodIMM32::OnWillChangeFocusedClient( |
TextInputClient* focused_before, |
TextInputClient* focused) { |
@@ -227,6 +235,25 @@ LRESULT InputMethodIMM32::OnImeEndComposition(HWND window_handle, |
return 0; |
} |
+LRESULT InputMethodIMM32::OnImeNotify(UINT message, |
+ WPARAM wparam, |
+ LPARAM lparam, |
+ BOOL* handled) { |
+ *handled = FALSE; |
+ |
+ // Update |is_candidate_popup_open_|, whether a candidate window is open. |
+ switch (wparam) { |
+ case IMN_OPENCANDIDATE: |
+ is_candidate_popup_open_ = true; |
+ break; |
+ case IMN_CLOSECANDIDATE: |
+ is_candidate_popup_open_ = false; |
+ break; |
+ } |
+ |
+ return 0; |
+} |
+ |
void InputMethodIMM32::ConfirmCompositionText() { |
if (composing_window_handle_) |
ime_input_.CleanupComposition(composing_window_handle_); |