Chromium Code Reviews| 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..857e67bd87cda706adcf56e98fcb5000ddba92e8 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); |
| + if (ime_candidate_window_open_) { |
| + // Don't allow the popup to overlap with the candidate window. |
|
Peter Kasting
2011/10/24 21:43:06
Nit: Hoist this comment above the conditional and
falken
2011/10/25 06:19:23
Done.
|
| + return; |
|
falken
2011/10/20 11:06:53
I'm not sure whether this return should be above t
Peter Kasting
2011/10/24 21:43:06
It probably should be where you have it, but do yo
falken
2011/10/25 06:19:23
Yes, it gets called as you change selection in the
|
| + } |
| + |
| 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) { |