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

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

Issue 8268003: Hide autocomplete popup when IME candidate window is open (on Windows). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: expand comment Created 9 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 0561bfe8e2fb27dc19bdf409f1c054e29ea01ee2..806cd51e3d1e9bffe39848c063d83bac3d50d247 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_win.cc
@@ -419,6 +419,7 @@ OmniboxViewWin::OmniboxViewWin(const gfx::Font& font,
in_drag_(false),
initiated_drag_(false),
drop_highlight_position_(-1),
+ ime_candidate_window_open_(false),
background_color_(skia::SkColorToCOLORREF(LocationBarView::GetColor(
ToolbarModel::NONE, LocationBarView::BACKGROUND))),
security_level_(ToolbarModel::NONE),
@@ -693,6 +694,11 @@ void OmniboxViewWin::UpdatePopup() {
ScopedFreeze freeze(this, GetTextObjectModel());
model_->SetInputInProgress(true);
+ // Don't allow the popup to open while the candidate window is open, so
+ // they don't overlap.
+ if (ime_candidate_window_open_)
+ return;
+
if (!model_->has_focus()) {
// When we're in the midst of losing focus, don't rerun autocomplete. This
// can happen when losing focus causes the IME to cancel/finalize a
@@ -1370,6 +1376,26 @@ LRESULT OmniboxViewWin::OnImeComposition(UINT message,
return result;
}
+LRESULT OmniboxViewWin::OnImeNotify(UINT message,
+ WPARAM wparam,
+ LPARAM lparam) {
+ // Close the popup when the IME composition window is open, so they don't
+ // overlap.
+ switch (wparam) {
+ case IMN_OPENCANDIDATE:
+ ime_candidate_window_open_ = true;
+ ClosePopup();
+ break;
+ case IMN_CLOSECANDIDATE:
+ ime_candidate_window_open_ = false;
+ UpdatePopup();
+ break;
+ default:
+ break;
+ }
+ return DefWindowProc(message, wparam, lparam);
+}
+
void OmniboxViewWin::OnKeyDown(TCHAR key,
UINT repeat_count,
UINT flags) {
« 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