OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ |
7 | 7 |
8 #include "app/gfx/font.h" | 8 #include "app/gfx/font.h" |
9 #include "app/slide_animation.h" | 9 #include "app/slide_animation.h" |
10 #include "chrome/browser/autocomplete/autocomplete.h" | 10 #include "chrome/browser/autocomplete/autocomplete.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // A view representing the contents of the autocomplete popup. | 48 // A view representing the contents of the autocomplete popup. |
49 class AutocompletePopupContentsView : public views::View, | 49 class AutocompletePopupContentsView : public views::View, |
50 public AutocompleteResultViewModel, | 50 public AutocompleteResultViewModel, |
51 public AutocompletePopupView, | 51 public AutocompletePopupView, |
52 public AnimationDelegate { | 52 public AnimationDelegate { |
53 public: | 53 public: |
54 AutocompletePopupContentsView(const gfx::Font& font, | 54 AutocompletePopupContentsView(const gfx::Font& font, |
55 AutocompleteEditView* edit_view, | 55 AutocompleteEditView* edit_view, |
56 AutocompleteEditModel* edit_model, | 56 AutocompleteEditModel* edit_model, |
57 Profile* profile, | 57 Profile* profile, |
58 AutocompletePopupPositioner* popup_positioner); | 58 const BubblePositioner* bubble_positioner); |
59 virtual ~AutocompletePopupContentsView() {} | 59 virtual ~AutocompletePopupContentsView() {} |
60 | 60 |
61 // Returns the bounds the popup should be shown at. This is the display bounds | 61 // Returns the bounds the popup should be shown at. This is the display bounds |
62 // and includes offsets for the dropshadow which this view's border renders. | 62 // and includes offsets for the dropshadow which this view's border renders. |
63 gfx::Rect GetPopupBounds() const; | 63 gfx::Rect GetPopupBounds() const; |
64 | 64 |
65 // Overridden from AutocompletePopupView: | 65 // Overridden from AutocompletePopupView: |
66 virtual bool IsOpen() const; | 66 virtual bool IsOpen() const; |
67 virtual void InvalidateLine(size_t line); | 67 virtual void InvalidateLine(size_t line); |
68 virtual void UpdatePopupAppearance(); | 68 virtual void UpdatePopupAppearance(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 scoped_ptr<AutocompletePopupGtk> popup_; | 110 scoped_ptr<AutocompletePopupGtk> popup_; |
111 #endif | 111 #endif |
112 | 112 |
113 // The provider of our result set. | 113 // The provider of our result set. |
114 scoped_ptr<AutocompletePopupModel> model_; | 114 scoped_ptr<AutocompletePopupModel> model_; |
115 | 115 |
116 // The edit view that invokes us. | 116 // The edit view that invokes us. |
117 AutocompleteEditView* edit_view_; | 117 AutocompleteEditView* edit_view_; |
118 | 118 |
119 // An object that tells the popup how to position itself. | 119 // An object that tells the popup how to position itself. |
120 AutocompletePopupPositioner* popup_positioner_; | 120 const BubblePositioner* bubble_positioner_; |
| 121 |
| 122 // Our border, which can compute our desired bounds. |
| 123 const BubbleBorder* bubble_border_; |
121 | 124 |
122 // The font that we should use for result rows. This is based on the font used | 125 // The font that we should use for result rows. This is based on the font used |
123 // by the edit that created us. | 126 // by the edit that created us. |
124 gfx::Font result_font_; | 127 gfx::Font result_font_; |
125 | 128 |
126 // The popup sizes vertically using an animation when the popup is getting | 129 // The popup sizes vertically using an animation when the popup is getting |
127 // shorter (not larger, that makes it look "slow"). | 130 // shorter (not larger, that makes it look "slow"). |
128 SlideAnimation size_animation_; | 131 SlideAnimation size_animation_; |
129 gfx::Rect start_bounds_; | 132 gfx::Rect start_bounds_; |
130 gfx::Rect target_bounds_; | 133 gfx::Rect target_bounds_; |
131 | 134 |
132 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 135 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
133 }; | 136 }; |
134 | 137 |
135 | 138 |
136 #endif // #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS
_VIEW_H_ | 139 #endif // #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS
_VIEW_H_ |
OLD | NEW |