diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 22:46:03 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 22:46:03 +0000 |
commit | 413df1b5ebacf0f3bc2ad03020e9f93b92717803 (patch) | |
tree | 92381b78a0b3a1682523b338428688bd4e23cd9e /chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc | |
parent | 76665e75f3f10a3171efd3bebfbd9c59a7648a00 (diff) | |
download | chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.zip chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.tar.gz chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.tar.bz2 |
Convert the AutocompletePopupPositioner into a BubblePositioner in preparation for using it to position both the Omnibox bubble and InfoBubbles. It now gets the bounds of the location stack, which can be turned into useful coordinates for both items.
This should not result in any visible change.
BUG=21028
TEST=none
Review URL: http://codereview.chromium.org/194110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26288 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 | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index fb98795..5c0b56c 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -20,6 +20,7 @@ #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view.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" @@ -242,10 +243,10 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner) + const BubblePositioner* bubble_positioner) : model_(new AutocompletePopupModel(this, edit_model, profile)), edit_view_(edit_view), - popup_positioner_(popup_positioner), + bubble_positioner_(bubble_positioner), window_(gtk_window_new(GTK_WINDOW_POPUP)), layout_(NULL), opened_(false) { @@ -335,7 +336,8 @@ AutocompletePopupModel* AutocompletePopupViewGtk::GetModel() { } void AutocompletePopupViewGtk::Show(size_t num_results) { - gfx::Rect rect = popup_positioner_->GetPopupBounds(); + 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()); @@ -509,7 +511,7 @@ AutocompletePopupView* AutocompletePopupView::CreatePopupView( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner) { + const BubblePositioner* bubble_positioner) { return new AutocompletePopupViewGtk(edit_view, edit_model, profile, - popup_positioner); + bubble_positioner); } |