Chromium Code Reviews| Index: ui/base/ime/input_method_tsf.cc |
| diff --git a/ui/base/ime/input_method_tsf.cc b/ui/base/ime/input_method_tsf.cc |
| old mode 100644 |
| new mode 100755 |
| index 6c433d6e0961247fb3546ed95fcb4bb1d3f8c4dd..67ce696f80b9fae23050c81e31c94d1ac03e357b |
| --- a/ui/base/ime/input_method_tsf.cc |
| +++ b/ui/base/ime/input_method_tsf.cc |
| @@ -11,7 +11,8 @@ namespace ui { |
| InputMethodTSF::InputMethodTSF(internal::InputMethodDelegate* delegate, |
| HWND toplevel_window_handle) |
| - : InputMethodWin(delegate, toplevel_window_handle) { |
| + : InputMethodWin(delegate, toplevel_window_handle), |
| + is_candidate_popup_open_(false) { |
| // In non-Aura environment, appropriate callbacks to OnFocus() and OnBlur() |
| // are not implemented yet. To work around this limitation, here we use |
| // "always focused" model. |
| @@ -61,6 +62,10 @@ bool InputMethodTSF::OnUntranslatedIMEMessage( |
| original_result = OnDeadChar( |
| event.message, event.wParam, event.lParam, &handled); |
| break; |
| + case WM_IME_NOTIFY: |
|
Yohei Yukawa
2013/06/21 06:45:47
Wait.
Please do not handle WM_IME_NOTIFY when TSF
|
| + original_result = OnImeNotify( |
| + event.message, event.wParam, event.lParam, &handled); |
| + break; |
| } |
| if (result) |
| *result = original_result; |
| @@ -93,6 +98,10 @@ void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) { |
| InputMethodWin::SetFocusedTextInputClient(client); |
| } |
| +bool InputMethodTSF::IsCandidatePopupOpen() const { |
| + return is_candidate_popup_open_; |
| +} |
| + |
| void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, |
| TextInputClient* focused) { |
| if (IsWindowFocused(focused_before)) { |
| @@ -117,6 +126,25 @@ void InputMethodTSF::OnDidChangeFocusedClient(TextInputClient* focused_before, |
| } |
| } |
| +LRESULT InputMethodTSF::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 InputMethodTSF::ConfirmCompositionText() { |
| if (!IsTextInputTypeNone()) { |
| // TSFBridge has not implemented ConfirmComposition yet. So here cancel |