Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/ime/input_method_tsf.h" | 5 #include "ui/base/ime/input_method_tsf.h" |
| 6 | 6 |
| 7 #include "ui/base/ime/text_input_client.h" | 7 #include "ui/base/ime/text_input_client.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| 11 InputMethodTSF::InputMethodTSF(internal::InputMethodDelegate* delegate, | 11 InputMethodTSF::InputMethodTSF(internal::InputMethodDelegate* delegate, |
| 12 HWND toplevel_window_handle) | 12 HWND toplevel_window_handle) |
| 13 : InputMethodWin(delegate, toplevel_window_handle) { | 13 : InputMethodWin(delegate, toplevel_window_handle), |
| 14 is_popup_open_(false) { | |
| 14 } | 15 } |
| 15 | 16 |
| 16 void InputMethodTSF::OnFocus() { | 17 void InputMethodTSF::OnFocus() { |
| 17 InputMethodWin::OnFocus(); | 18 InputMethodWin::OnFocus(); |
| 18 NOTIMPLEMENTED(); | 19 NOTIMPLEMENTED(); |
| 19 } | 20 } |
| 20 | 21 |
| 21 void InputMethodTSF::OnBlur() { | 22 void InputMethodTSF::OnBlur() { |
| 22 NOTIMPLEMENTED(); | 23 NOTIMPLEMENTED(); |
| 23 InputMethodWin::OnBlur(); | 24 InputMethodWin::OnBlur(); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 45 // - Another application sends WM_CHAR through SendMessage API. | 46 // - Another application sends WM_CHAR through SendMessage API. |
| 46 original_result = OnChar( | 47 original_result = OnChar( |
| 47 event.message, event.wParam, event.lParam, &handled); | 48 event.message, event.wParam, event.lParam, &handled); |
| 48 break; | 49 break; |
| 49 case WM_DEADCHAR: | 50 case WM_DEADCHAR: |
| 50 case WM_SYSDEADCHAR: | 51 case WM_SYSDEADCHAR: |
| 51 // See the comment in WM_CHAR/WM_SYSCHAR. | 52 // See the comment in WM_CHAR/WM_SYSCHAR. |
| 52 original_result = OnDeadChar( | 53 original_result = OnDeadChar( |
| 53 event.message, event.wParam, event.lParam, &handled); | 54 event.message, event.wParam, event.lParam, &handled); |
| 54 break; | 55 break; |
| 56 case WM_IME_NOTIFY: | |
|
Yohei Yukawa
2013/06/19 09:23:07
I guess WM_IME_NOTIFY is not supported on Metro mo
| |
| 57 original_result = OnImeNotify( | |
| 58 event.message, event.wParam, event.lParam, &handled); | |
| 59 break; | |
| 55 } | 60 } |
| 56 if (result) | 61 if (result) |
| 57 *result = original_result; | 62 *result = original_result; |
| 58 return !!handled; | 63 return !!handled; |
| 59 } | 64 } |
| 60 | 65 |
| 61 void InputMethodTSF::OnTextInputTypeChanged(const TextInputClient* client) { | 66 void InputMethodTSF::OnTextInputTypeChanged(const TextInputClient* client) { |
| 62 NOTIMPLEMENTED(); | 67 NOTIMPLEMENTED(); |
| 63 InputMethodWin::OnTextInputTypeChanged(client); | 68 InputMethodWin::OnTextInputTypeChanged(client); |
| 64 } | 69 } |
| 65 | 70 |
| 66 void InputMethodTSF::OnCaretBoundsChanged(const TextInputClient* client) { | 71 void InputMethodTSF::OnCaretBoundsChanged(const TextInputClient* client) { |
| 67 NOTIMPLEMENTED(); | 72 NOTIMPLEMENTED(); |
| 68 } | 73 } |
| 69 | 74 |
| 70 void InputMethodTSF::CancelComposition(const TextInputClient* client) { | 75 void InputMethodTSF::CancelComposition(const TextInputClient* client) { |
| 71 NOTIMPLEMENTED(); | 76 NOTIMPLEMENTED(); |
| 72 } | 77 } |
| 73 | 78 |
| 74 void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) { | 79 void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) { |
| 75 NOTIMPLEMENTED(); | 80 NOTIMPLEMENTED(); |
| 76 InputMethodWin::SetFocusedTextInputClient(client); | 81 InputMethodWin::SetFocusedTextInputClient(client); |
| 77 } | 82 } |
| 78 | 83 |
| 84 bool InputMethodTSF::IsPopupOpen() const { | |
| 85 return is_popup_open_; | |
| 86 } | |
| 87 | |
| 79 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, | 88 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, |
| 80 TextInputClient* focused) { | 89 TextInputClient* focused) { |
| 81 NOTIMPLEMENTED(); | 90 NOTIMPLEMENTED(); |
| 82 } | 91 } |
| 83 | 92 |
| 84 void InputMethodTSF::OnDidChangeFocusedClient(TextInputClient* focused_before, | 93 void InputMethodTSF::OnDidChangeFocusedClient(TextInputClient* focused_before, |
| 85 TextInputClient* focused) { | 94 TextInputClient* focused) { |
| 86 NOTIMPLEMENTED(); | 95 NOTIMPLEMENTED(); |
| 87 } | 96 } |
| 88 | 97 |
| 98 LRESULT InputMethodTSF::OnImeNotify(UINT message, | |
| 99 WPARAM wparam, | |
| 100 LPARAM lparam, | |
| 101 BOOL* handled) { | |
| 102 *handled = FALSE; | |
| 103 | |
| 104 // Update |is_popup_open_|, whether a candidate window is open or not. | |
| 105 switch (wparam) { | |
| 106 case IMN_OPENCANDIDATE: | |
| 107 is_popup_open_ = true; | |
| 108 break; | |
| 109 case IMN_CLOSECANDIDATE: | |
| 110 is_popup_open_ = false; | |
| 111 break; | |
| 112 } | |
| 113 | |
| 114 return 0; | |
| 115 } | |
| 116 | |
| 89 void InputMethodTSF::ConfirmCompositionText() { | 117 void InputMethodTSF::ConfirmCompositionText() { |
| 90 NOTIMPLEMENTED(); | 118 NOTIMPLEMENTED(); |
| 91 } | 119 } |
| 92 | 120 |
| 93 } // namespace ui | 121 } // namespace ui |
| OLD | NEW |