diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 08:20:19 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 08:20:19 +0000 |
commit | aeba67b45fc66b5c03205a470cb87d3995ab198a (patch) | |
tree | 84dcd8a86108ddd2b0c18e40795dfbea1b32dc7d /chrome/browser/views | |
parent | f35334961b26e1382810780a99761c8fc1086d5f (diff) | |
download | chromium_src-aeba67b45fc66b5c03205a470cb87d3995ab198a.zip chromium_src-aeba67b45fc66b5c03205a470cb87d3995ab198a.tar.gz chromium_src-aeba67b45fc66b5c03205a470cb87d3995ab198a.tar.bz2 |
Linux: Stack autocomplete popup window directly on top of the browser's toplevel window.
BUG=19082 "Linux: Omnibox auto-complete popup is on top of IME candidate window when using SCIM"
TEST=Please refer to the bug report for how to test.
Review URL: http://codereview.chromium.org/274046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc | 16 | ||||
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_gtk.h | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc b/chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc index 0905546..d7698ec 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc @@ -8,6 +8,7 @@ #include "chrome/browser/autocomplete/autocomplete_edit_view.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" +#include "chrome/common/gtk_util.h" //////////////////////////////////////////////////////////////////////////////// // AutocompletePopupGtk, public: @@ -15,7 +16,8 @@ AutocompletePopupGtk::AutocompletePopupGtk( AutocompletePopupContentsView* contents) : WidgetGtk(WidgetGtk::TYPE_POPUP), - contents_(contents) { + contents_(contents), + edit_view_(NULL) { set_delete_on_destroy(false); } @@ -31,14 +33,18 @@ void AutocompletePopupGtk::Init(AutocompleteEditView* edit_view, // The contents is owned by the LocationBarView. contents_->SetParentOwned(false); SetContentsView(contents_); + + edit_view_ = edit_view; } void AutocompletePopupGtk::Show() { // Move the popup to the place appropriate for the window's current position - // it may have been moved since it was last shown. SetBounds(contents_->GetPopupBounds()); - if (!IsVisible()) + if (!IsVisible()) { WidgetGtk::Show(); + StackWindow(); + } } bool AutocompletePopupGtk::IsOpen() const { @@ -48,3 +54,9 @@ bool AutocompletePopupGtk::IsOpen() const { bool AutocompletePopupGtk::IsCreated() const { return GTK_IS_WIDGET(GetNativeView()); } + +void AutocompletePopupGtk::StackWindow() { + GtkWidget* toplevel = gtk_widget_get_toplevel(edit_view_->GetNativeView()); + DCHECK(GTK_WIDGET_TOPLEVEL(toplevel)); + gtk_util::StackPopupWindow(GetNativeView(), toplevel); +} diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_gtk.h b/chrome/browser/views/autocomplete/autocomplete_popup_gtk.h index 3ae2625..08e003e 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_gtk.h +++ b/chrome/browser/views/autocomplete/autocomplete_popup_gtk.h @@ -28,8 +28,12 @@ class AutocompletePopupGtk : public views::WidgetGtk { // Returns true if the popup has been created. bool IsCreated() const; + // Restack the popup window directly above the browser's toplevel window. + void StackWindow(); + private: AutocompletePopupContentsView* contents_; + AutocompleteEditView* edit_view_; DISALLOW_COPY_AND_ASSIGN(AutocompletePopupGtk); }; |