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

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

Issue 17112021: New method: InputMethod::IsCandidatePopupOpen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. 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
« no previous file with comments | « ui/base/ime/input_method_imm32.h ('k') | ui/base/ime/input_method_tsf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « ui/base/ime/input_method_imm32.h ('k') | ui/base/ime/input_method_tsf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698