Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete.h" | 10 #include "chrome/browser/autocomplete/autocomplete.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 namespace views { | 25 namespace views { |
| 26 class BubbleBorder; | 26 class BubbleBorder; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // A view representing the contents of the autocomplete popup. | 29 // A view representing the contents of the autocomplete popup. |
| 30 class AutocompletePopupContentsView : public views::View, | 30 class AutocompletePopupContentsView : public views::View, |
| 31 public AutocompleteResultViewModel, | 31 public AutocompleteResultViewModel, |
| 32 public AutocompletePopupView, | 32 public AutocompletePopupView, |
| 33 public ui::AnimationDelegate { | 33 public ui::AnimationDelegate { |
| 34 public: | 34 public: |
| 35 // Creates the appropriate type of omnibox dropdown for the | |
| 36 // current environment, e.g. desktop vs. touch optimized layout. | |
| 37 static AutocompletePopupContentsView* CreateForEnvironment( | |
| 38 const gfx::Font& font, | |
| 39 OmniboxView* omnibox_view, | |
| 40 AutocompleteEditModel* edit_model, | |
| 41 views::View* location_bar); | |
| 42 | |
| 35 AutocompletePopupContentsView(const gfx::Font& font, | 43 AutocompletePopupContentsView(const gfx::Font& font, |
|
Peter Kasting
2012/05/07 21:03:12
Nit: This can become protected.
Jói
2012/05/10 18:33:07
Done.
| |
| 36 OmniboxView* omnibox_view, | 44 OmniboxView* omnibox_view, |
| 37 AutocompleteEditModel* edit_model, | 45 AutocompleteEditModel* edit_model, |
| 38 views::View* location_bar); | 46 views::View* location_bar); |
| 39 virtual ~AutocompletePopupContentsView(); | 47 virtual ~AutocompletePopupContentsView(); |
| 40 | 48 |
| 49 // Call immediately after construction. | |
|
Peter Kasting
2012/05/07 21:03:12
Nit: This can become private.
Jói
2012/05/10 18:33:07
Done.
| |
| 50 void Init(); | |
| 51 | |
| 41 // Returns the bounds the popup should be shown at. This is the display bounds | 52 // Returns the bounds the popup should be shown at. This is the display bounds |
| 42 // and includes offsets for the dropshadow which this view's border renders. | 53 // and includes offsets for the dropshadow which this view's border renders. |
| 43 gfx::Rect GetPopupBounds() const; | 54 gfx::Rect GetPopupBounds() const; |
| 44 | 55 |
| 45 virtual void LayoutChildren(); | 56 virtual void LayoutChildren(); |
| 46 | 57 |
| 47 // Overridden from AutocompletePopupView: | 58 // Overridden from AutocompletePopupView: |
| 48 virtual bool IsOpen() const OVERRIDE; | 59 virtual bool IsOpen() const OVERRIDE; |
| 49 virtual void InvalidateLine(size_t line) OVERRIDE; | 60 virtual void InvalidateLine(size_t line) OVERRIDE; |
| 50 virtual void UpdatePopupAppearance() OVERRIDE; | 61 virtual void UpdatePopupAppearance() OVERRIDE; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 // The popup sizes vertically using an animation when the popup is getting | 170 // The popup sizes vertically using an animation when the popup is getting |
| 160 // shorter (not larger, that makes it look "slow"). | 171 // shorter (not larger, that makes it look "slow"). |
| 161 ui::SlideAnimation size_animation_; | 172 ui::SlideAnimation size_animation_; |
| 162 gfx::Rect start_bounds_; | 173 gfx::Rect start_bounds_; |
| 163 gfx::Rect target_bounds_; | 174 gfx::Rect target_bounds_; |
| 164 | 175 |
| 165 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 176 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
| 166 }; | 177 }; |
| 167 | 178 |
| 168 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW _H_ | 179 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW _H_ |
| OLD | NEW |