| 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 19 matching lines...) Expand all Loading... |
| 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, | 39 Profile* profile, |
| 40 const views::View* location_bar); | 40 views::View* location_bar); |
| 41 virtual ~AutocompletePopupContentsView(); | 41 virtual ~AutocompletePopupContentsView(); |
| 42 | 42 |
| 43 // Returns the bounds the popup should be shown at. This is the display bounds | 43 // 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. | 44 // and includes offsets for the dropshadow which this view's border renders. |
| 45 gfx::Rect GetPopupBounds() const; | 45 gfx::Rect GetPopupBounds() const; |
| 46 | 46 |
| 47 virtual void LayoutChildren(); | 47 virtual void LayoutChildren(); |
| 48 | 48 |
| 49 // Overridden from AutocompletePopupView: | 49 // Overridden from AutocompletePopupView: |
| 50 virtual bool IsOpen() const OVERRIDE; | 50 virtual bool IsOpen() const OVERRIDE; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // The popup that contains this view. We create this, but it deletes itself | 137 // 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 | 138 // 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 | 139 // the OS to destroy the window and thus delete this object before we're |
| 140 // deleted, or without our knowledge. | 140 // deleted, or without our knowledge. |
| 141 base::WeakPtr<AutocompletePopupWidget> popup_; | 141 base::WeakPtr<AutocompletePopupWidget> popup_; |
| 142 | 142 |
| 143 // The edit view that invokes us. | 143 // The edit view that invokes us. |
| 144 OmniboxView* omnibox_view_; | 144 OmniboxView* omnibox_view_; |
| 145 | 145 |
| 146 // An object that the popup positions itself against. | 146 // An object that the popup positions itself against. |
| 147 const views::View* location_bar_; | 147 views::View* location_bar_; |
| 148 | 148 |
| 149 // Our border, which can compute our desired bounds. | 149 // Our border, which can compute our desired bounds. |
| 150 const BubbleBorder* bubble_border_; | 150 const BubbleBorder* bubble_border_; |
| 151 | 151 |
| 152 // The font that we should use for result rows. This is based on the font used | 152 // The font that we should use for result rows. This is based on the font used |
| 153 // by the edit that created us. | 153 // by the edit that created us. |
| 154 gfx::Font result_font_; | 154 gfx::Font result_font_; |
| 155 | 155 |
| 156 // The font used for portions that match the input. | 156 // The font used for portions that match the input. |
| 157 gfx::Font result_bold_font_; | 157 gfx::Font result_bold_font_; |
| 158 | 158 |
| 159 // If the user cancels a dragging action (i.e. by pressing ESC), we don't have | 159 // If the user cancels a dragging action (i.e. by pressing ESC), we don't have |
| 160 // a convenient way to release mouse capture. Instead we use this flag to | 160 // a convenient way to release mouse capture. Instead we use this flag to |
| 161 // simply ignore all remaining drag events, and the eventual mouse release | 161 // simply ignore all remaining drag events, and the eventual mouse release |
| 162 // event. Since OnDragCanceled() can be called when we're not dragging, this | 162 // event. Since OnDragCanceled() can be called when we're not dragging, this |
| 163 // flag is reset to false on a mouse pressed event, to make sure we don't | 163 // flag is reset to false on a mouse pressed event, to make sure we don't |
| 164 // erroneously ignore the next drag. | 164 // erroneously ignore the next drag. |
| 165 bool ignore_mouse_drag_; | 165 bool ignore_mouse_drag_; |
| 166 | 166 |
| 167 // The popup sizes vertically using an animation when the popup is getting | 167 // The popup sizes vertically using an animation when the popup is getting |
| 168 // shorter (not larger, that makes it look "slow"). | 168 // shorter (not larger, that makes it look "slow"). |
| 169 ui::SlideAnimation size_animation_; | 169 ui::SlideAnimation size_animation_; |
| 170 gfx::Rect start_bounds_; | 170 gfx::Rect start_bounds_; |
| 171 gfx::Rect target_bounds_; | 171 gfx::Rect target_bounds_; |
| 172 | 172 |
| 173 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 173 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ | 176 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ |
| OLD | NEW |