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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_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/autocomplete/autocomplete_popup_view_gtk.h ('k') | chrome/browser/gtk/info_bubble_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc (revision 29084)
+++ chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc (working copy)
@@ -18,13 +18,14 @@
#include "base/string_util.h"
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_edit.h"
-#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
+#include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h"
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
#include "chrome/browser/bubble_positioner.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/common/gtk_util.h"
#include "chrome/common/notification_service.h"
#include "grit/theme_resources.h"
@@ -345,6 +346,7 @@
gtk_window_move(GTK_WINDOW(window_), rect.x(), rect.y());
gtk_widget_set_size_request(window_, rect.width(), rect.height());
gtk_widget_show(window_);
+ StackWindow();
opened_ = true;
}
@@ -353,6 +355,14 @@
opened_ = false;
}
+void AutocompletePopupViewGtk::StackWindow() {
+ gfx::NativeView edit_view = edit_view_->GetNativeView();
+ DCHECK(GTK_IS_WIDGET(edit_view));
+ GtkWidget* toplevel = gtk_widget_get_toplevel(edit_view);
+ DCHECK(GTK_WIDGET_TOPLEVEL(toplevel));
+ gtk_util::StackPopupWindow(window_, toplevel);
+}
+
size_t AutocompletePopupViewGtk::LineFromY(int y) {
size_t line = std::max(y - kBorderThickness, 0) / kHeightPerResult;
return std::min(line, model_->result().size() - 1);
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_popup_view_gtk.h ('k') | chrome/browser/gtk/info_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698