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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_win.cc

Issue 11093044: Fix omnibox suggestion: restore selection on WM_IME_ENDCOMPOSITION (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 8 years, 2 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 | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_win.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
index ca7e4c575737eca669711b7c6a025afbb7c9694d..35e5dd435267cce2d68b8de6a2202edc5423d1fa 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -1418,6 +1418,21 @@ LRESULT OmniboxViewWin::OnImeComposition(UINT message,
return result;
}
+
+LRESULT OmniboxViewWin::OnImeEndComposition(UINT message, WPARAM wparam,
+ LPARAM lparam) {
+ // The edit control auto-clears the selection on WM_IME_ENDCOMPOSITION, which
+ // means any inline autocompletion we were showing will no longer be
+ // selected, and therefore no longer replaced by further user typing. To
+ // avoid this we manually restore the original selection after the edit
+ // handles the message.
+ CHARRANGE range;
+ GetSel(range);
+ LRESULT result = DefWindowProc(message, wparam, lparam);
+ SetSel(range);
+ return result;
+}
+
LRESULT OmniboxViewWin::OnImeNotify(UINT message,
WPARAM wparam,
LPARAM lparam) {
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698