diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 18:57:03 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 18:57:03 +0000 |
commit | a2b35465c42e3bb3f85c22a869e0dce74b5d8a4c (patch) | |
tree | e800a3fd638bda7b597b8fd0b76af50d3d049ea5 /chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | |
parent | 5e49b2ce1dc358328ab732520b17414b44081712 (diff) | |
download | chromium_src-a2b35465c42e3bb3f85c22a869e0dce74b5d8a4c.zip chromium_src-a2b35465c42e3bb3f85c22a869e0dce74b5d8a4c.tar.gz chromium_src-a2b35465c42e3bb3f85c22a869e0dce74b5d8a4c.tar.bz2 |
Shift omnibox dropdown in and up on Windows, and square off the top, so it connects to the location bar. Also fix info bubble positioning against location bar icons to put the arrow "up against the icon edge" (fixes the arrow overlapping some page action icons).
Remove BubblePositioner, which is now no longer needed.
BUG=27570,40730
TEST=Omnibox dropdown should line up with editable area edges, icons and text should line up with icon and text in the omnibox. Info bubbles should still be positioned correctly
Review URL: http://codereview.chromium.org/1578021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index b43b3d1..6225dc6 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,7 +18,6 @@ #include "chrome/browser/autocomplete/autocomplete_edit.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/gtk/gtk_theme_provider.h" #include "chrome/browser/gtk/gtk_util.h" @@ -223,10 +222,10 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - const BubblePositioner* bubble_positioner) + const GtkWidget* location_bar) : model_(new AutocompletePopupModel(this, edit_model, profile)), edit_view_(edit_view), - bubble_positioner_(bubble_positioner), + location_bar_(location_bar), window_(gtk_window_new(GTK_WINDOW_POPUP)), layout_(NULL), theme_provider_(GtkThemeProvider::GetFrom(profile)), @@ -372,15 +371,18 @@ void AutocompletePopupViewGtk::Observe(NotificationType type, } void AutocompletePopupViewGtk::Show(size_t num_results) { - gfx::Rect rect = bubble_positioner_->GetLocationStackBounds(); - rect.set_y(rect.bottom()); - rect.set_height((num_results * kHeightPerResult) + (kBorderThickness * 2)); - - 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; + gint origin_x, origin_y; + gdk_window_get_origin(location_bar_->window, &origin_x, &origin_y); + const GtkAllocation& allocation = location_bar_->allocation; + gtk_window_move(GTK_WINDOW(window_), + origin_x + allocation.x - kBorderThickness, + origin_y + allocation.y + allocation.height - kBorderThickness - 1); + gtk_widget_set_size_request(window_, + allocation.width + (kBorderThickness * 2), + (num_results * kHeightPerResult) + (kBorderThickness * 2)); + gtk_widget_show(window_); + StackWindow(); + opened_ = true; } void AutocompletePopupViewGtk::Hide() { @@ -566,14 +568,3 @@ gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, return TRUE; } - -// static -AutocompletePopupView* AutocompletePopupView::CreatePopupView( - const gfx::Font& font, - AutocompleteEditView* edit_view, - AutocompleteEditModel* edit_model, - Profile* profile, - const BubblePositioner* bubble_positioner) { - return new AutocompletePopupViewGtk(edit_view, edit_model, profile, - bubble_positioner); -} |