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

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

Issue 17112021: New method: InputMethod::IsCandidatePopupOpen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed test code Created 7 years, 6 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
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
index 41f0ba0600213ba7ce89f2f419c8965b7f3e231d..7623227dcae52c74b8862178e1970780658264cb 100644
--- a/ui/base/ime/input_method_tsf.cc
+++ b/ui/base/ime/input_method_tsf.cc
@@ -10,7 +10,8 @@ namespace ui {
InputMethodTSF::InputMethodTSF(internal::InputMethodDelegate* delegate,
HWND toplevel_window_handle)
- : InputMethodWin(delegate, toplevel_window_handle) {
+ : InputMethodWin(delegate, toplevel_window_handle),
+ is_popup_open_(false) {
}
void InputMethodTSF::OnFocus() {
@@ -52,6 +53,10 @@ bool InputMethodTSF::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;
}
if (result)
*result = original_result;
@@ -76,6 +81,10 @@ void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) {
InputMethodWin::SetFocusedTextInputClient(client);
}
+bool InputMethodTSF::IsPopupOpen() const {
+ return is_popup_open_;
+}
+
void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before,
TextInputClient* focused) {
NOTIMPLEMENTED();
@@ -86,6 +95,25 @@ void InputMethodTSF::OnDidChangeFocusedClient(TextInputClient* focused_before,
NOTIMPLEMENTED();
}
+LRESULT InputMethodTSF::OnImeNotify(UINT message,
+ WPARAM wparam,
+ LPARAM lparam,
+ BOOL* handled) {
+ *handled = FALSE;
Seigo Nonaka 2013/06/19 09:15:51 Is it okay not to use TsfEventRouter for pure TSF
Yuki 2013/06/19 09:35:54 I'll support it in a separate CL later, as Yukawa-
+
+ // Update |is_popup_open_|, whether a candidate window is open or not.
+ switch (wparam) {
+ case IMN_OPENCANDIDATE:
+ is_popup_open_ = true;
+ break;
+ case IMN_CLOSECANDIDATE:
+ is_popup_open_ = false;
+ break;
+ }
+
+ return 0;
+}
+
void InputMethodTSF::ConfirmCompositionText() {
NOTIMPLEMENTED();
}

Powered by Google App Engine
This is Rietveld 408576698