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

Unified Diff: chrome/browser/gtk/browser_toolbar_gtk.cc

Issue 194110: Convert the AutocompletePopupPositioner into a BubblePositioner in preparatio... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
Index: chrome/browser/gtk/browser_toolbar_gtk.cc
===================================================================
--- chrome/browser/gtk/browser_toolbar_gtk.cc (revision 26251)
+++ chrome/browser/gtk/browser_toolbar_gtk.cc (working copy)
@@ -61,15 +61,6 @@
// Interior spacing between toolbar widgets.
const int kToolbarWidgetSpacing = 4;
-// The amount of space between the bottom of the star and the top of the
-// Omnibox results popup window. We want a two pixel space between the bottom
-// and the results, but have some extra space below the buttons already.
-const int kPopupTopMargin = 0;
-
-// Space between the edge of the star/go button and the popup frame. We want
-// to leave 1 pixel on both side here so that the borders line up.
-const int kPopupLeftRightMargin = 1;
-
// The color used as the base[] color of the location entry during a secure
// connection.
const GdkColor kSecureColor = GDK_COLOR_RGB(255, 245, 195);
@@ -425,7 +416,13 @@
location_bar_->Update(should_restore_state ? contents : NULL);
}
-gfx::Rect BrowserToolbarGtk::GetPopupBounds() const {
+gfx::Rect BrowserToolbarGtk::GetLocationStackBounds() const {
+ // The number of pixels from the left or right edges of the location stack to
+ // "just inside the visible borders". When the omnibox bubble contents are
+ // aligned with this, the visible borders tacked on to the outsides will line
+ // up with the visible borders on the location stack.
+ const int kLocationStackEdgeWidth = 1;
+
GtkWidget* left;
GtkWidget* right;
if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) {
@@ -441,16 +438,14 @@
gdk_window_get_origin(left->window, &origin_x, &origin_y);
gint right_x = origin_x + right->allocation.x + right->allocation.width;
-
gint left_x = origin_x + left->allocation.x;
-
- // Bottom edge.
- gint left_y = origin_y + left->allocation.y + left->allocation.height;
-
DCHECK_LE(left_x, right_x);
- return gfx::Rect(left_x + kPopupLeftRightMargin, left_y + kPopupTopMargin,
- right_x - left_x - (2 * kPopupLeftRightMargin), 0);
+ gfx::Rect stack_bounds(left_x, origin_y + left->allocation.y,
+ right_x - left_x, left->allocation.height);
+ // Inset the bounds to just inside the visible edges (see comment above).
+ stack_bounds.Inset(kLocationStackEdgeWidth, 0);
+ return stack_bounds;
}
// BrowserToolbarGtk, private --------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698