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

Unified Diff: ui/views/ime/input_method_win.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/views/ime/input_method_win.h ('k') | ui/views/ime/mock_input_method.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/ime/input_method_win.cc
diff --git a/ui/views/ime/input_method_win.cc b/ui/views/ime/input_method_win.cc
old mode 100644
new mode 100755
index 35c0a4252723dfe63c4da6deb70da5faf6839614..1cd18d8ac66e44876a6e972663ebd1e05f6f0198
--- a/ui/views/ime/input_method_win.cc
+++ b/ui/views/ime/input_method_win.cc
@@ -27,6 +27,7 @@ InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate,
ui::InputMethod* host)
: hwnd_(hwnd),
active_(false),
+ is_candidate_popup_open_(false),
direction_(base::i18n::UNKNOWN_DIRECTION),
pending_requested_direction_(base::i18n::UNKNOWN_DIRECTION),
host_(host) {
@@ -78,6 +79,10 @@ bool InputMethodWin::OnUntranslatedIMEMessage(const base::NativeEvent& event,
original_result = OnImeRequest(
event.message, event.wParam, event.lParam, &handled);
break;
+ case WM_IME_NOTIFY:
+ original_result = OnImeNotify(
+ event.message, event.wParam, event.lParam, &handled);
+ break;
case WM_CHAR:
case WM_SYSCHAR:
original_result = OnChar(
@@ -167,6 +172,10 @@ ui::TextInputClient* InputMethodWin::GetTextInputClient() const {
return host_ ? host_->GetTextInputClient() : NULL;
}
+bool InputMethodWin::IsCandidatePopupOpen() const {
+ return is_candidate_popup_open_;
+}
+
void InputMethodWin::OnWillChangeFocus(View* focused_before, View* focused) {
ConfirmCompositionText();
}
@@ -274,6 +283,23 @@ LRESULT InputMethodWin::OnImeRequest(
}
}
+LRESULT InputMethodWin::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;
+}
+
LRESULT InputMethodWin::OnChar(
UINT message, WPARAM wparam, LPARAM lparam, BOOL* handled) {
*handled = TRUE;
« no previous file with comments | « ui/views/ime/input_method_win.h ('k') | ui/views/ime/mock_input_method.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698