diff options
Diffstat (limited to 'chrome/browser/views/autocomplete/autocomplete_popup_win.h')
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_win.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_win.h b/chrome/browser/views/autocomplete/autocomplete_popup_win.h index 9c8be43..ed25678 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_win.h +++ b/chrome/browser/views/autocomplete/autocomplete_popup_win.h @@ -10,15 +10,26 @@ class AutocompleteEditModel; class AutocompleteEditViewWin; +class AutocompletePopupViewContents; class Profile; +// Interface to retrieve the position of the popup. +class AutocompletePopupPositioner { + public: + // Returns the bounds at which the popup should be shown, in screen + // coordinates. The height is ignored, since the popup is sized to its + // contents automatically. + virtual gfx::Rect GetPopupBounds() const = 0; +}; + class AutocompletePopupWin : public views::WidgetWin, public AutocompletePopupView { public: AutocompletePopupWin(const ChromeFont& font, AutocompleteEditViewWin* edit_view, AutocompleteEditModel* edit_model, - Profile* profile); + Profile* profile, + AutocompletePopupPositioner* popup_positioner); virtual ~AutocompletePopupWin(); // Overridden from AutocompletePopupView: @@ -30,14 +41,22 @@ class AutocompletePopupWin : public views::WidgetWin, virtual AutocompletePopupModel* GetModel(); private: - // Returns the bounds the popup should be created or shown at, in screen - // coordinates. - gfx::Rect GetPopupScreenBounds() const; + // Returns the bounds of the popup window, in screen coordinates, adjusted for + // the amount of drop shadow the contents view may wish to add. + gfx::Rect GetPopupBounds() const; + // The provider of our result set. scoped_ptr<AutocompletePopupModel> model_; + // The edit view that invokes us. AutocompleteEditViewWin* edit_view_; + // An object that tells the popup how to position itself. + AutocompletePopupPositioner* popup_positioner_; + + // The view that holds the result views. + AutocompletePopupViewContents* contents_; + DISALLOW_COPY_AND_ASSIGN(AutocompletePopupWin); }; |