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

Unified Diff: chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc

Issue 274046: Linux: Stack autocomplete popup window directly on top of the browser's tople... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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/views/autocomplete/autocomplete_popup_gtk.h ('k') | chrome/common/gtk_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc
===================================================================
--- chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc (revision 29084)
+++ chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc (working copy)
@@ -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 @@
// 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::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);
+}
« no previous file with comments | « chrome/browser/views/autocomplete/autocomplete_popup_gtk.h ('k') | chrome/common/gtk_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698