OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/autocomplete/autocomplete.h" | 9 #include "chrome/browser/autocomplete/autocomplete.h" |
10 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 10 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 // A view representing the contents of the autocomplete popup. | 30 // A view representing the contents of the autocomplete popup. |
31 class AutocompletePopupContentsView : public views::View, | 31 class AutocompletePopupContentsView : public views::View, |
32 public AutocompleteResultViewModel, | 32 public AutocompleteResultViewModel, |
33 public AutocompletePopupView, | 33 public AutocompletePopupView, |
34 public ui::AnimationDelegate { | 34 public ui::AnimationDelegate { |
35 public: | 35 public: |
36 AutocompletePopupContentsView(const gfx::Font& font, | 36 AutocompletePopupContentsView(const gfx::Font& font, |
37 OmniboxView* omnibox_view, | 37 OmniboxView* omnibox_view, |
38 AutocompleteEditModel* edit_model, | 38 AutocompleteEditModel* edit_model, |
39 Profile* profile, | |
40 const views::View* location_bar); | 39 const views::View* location_bar); |
41 virtual ~AutocompletePopupContentsView(); | 40 virtual ~AutocompletePopupContentsView(); |
42 | 41 |
43 // Returns the bounds the popup should be shown at. This is the display bounds | 42 // Returns the bounds the popup should be shown at. This is the display bounds |
44 // and includes offsets for the dropshadow which this view's border renders. | 43 // and includes offsets for the dropshadow which this view's border renders. |
45 gfx::Rect GetPopupBounds() const; | 44 gfx::Rect GetPopupBounds() const; |
46 | 45 |
47 virtual void LayoutChildren(); | 46 virtual void LayoutChildren(); |
48 | 47 |
49 // Overridden from AutocompletePopupView: | 48 // Overridden from AutocompletePopupView: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 135 |
137 // The popup that contains this view. We create this, but it deletes itself | 136 // The popup that contains this view. We create this, but it deletes itself |
138 // when its window is destroyed. This is a WeakPtr because it's possible for | 137 // when its window is destroyed. This is a WeakPtr because it's possible for |
139 // the OS to destroy the window and thus delete this object before we're | 138 // the OS to destroy the window and thus delete this object before we're |
140 // deleted, or without our knowledge. | 139 // deleted, or without our knowledge. |
141 base::WeakPtr<AutocompletePopupWidget> popup_; | 140 base::WeakPtr<AutocompletePopupWidget> popup_; |
142 | 141 |
143 // The edit view that invokes us. | 142 // The edit view that invokes us. |
144 OmniboxView* omnibox_view_; | 143 OmniboxView* omnibox_view_; |
145 | 144 |
| 145 Profile* profile_; |
| 146 |
146 // An object that the popup positions itself against. | 147 // An object that the popup positions itself against. |
147 const views::View* location_bar_; | 148 const views::View* location_bar_; |
148 | 149 |
149 // Our border, which can compute our desired bounds. | 150 // Our border, which can compute our desired bounds. |
150 const BubbleBorder* bubble_border_; | 151 const BubbleBorder* bubble_border_; |
151 | 152 |
152 // The font that we should use for result rows. This is based on the font used | 153 // The font that we should use for result rows. This is based on the font used |
153 // by the edit that created us. | 154 // by the edit that created us. |
154 gfx::Font result_font_; | 155 gfx::Font result_font_; |
155 | 156 |
(...skipping 11 matching lines...) Expand all Loading... |
167 // The popup sizes vertically using an animation when the popup is getting | 168 // The popup sizes vertically using an animation when the popup is getting |
168 // shorter (not larger, that makes it look "slow"). | 169 // shorter (not larger, that makes it look "slow"). |
169 ui::SlideAnimation size_animation_; | 170 ui::SlideAnimation size_animation_; |
170 gfx::Rect start_bounds_; | 171 gfx::Rect start_bounds_; |
171 gfx::Rect target_bounds_; | 172 gfx::Rect target_bounds_; |
172 | 173 |
173 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 174 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
174 }; | 175 }; |
175 | 176 |
176 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ | 177 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ |
OLD | NEW |