| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 virtual void AnimationProgressed(const Animation* animation); | 74 virtual void AnimationProgressed(const Animation* animation); |
| 75 | 75 |
| 76 // Overridden from views::View: | 76 // Overridden from views::View: |
| 77 virtual void Paint(gfx::Canvas* canvas); | 77 virtual void Paint(gfx::Canvas* canvas); |
| 78 virtual void PaintChildren(gfx::Canvas* canvas) { | 78 virtual void PaintChildren(gfx::Canvas* canvas) { |
| 79 // We paint our children inside Paint(). | 79 // We paint our children inside Paint(). |
| 80 } | 80 } |
| 81 virtual void Layout(); | 81 virtual void Layout(); |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 #if defined(OS_WIN) |
| 85 typedef AutocompletePopupWin AutocompletePopupClass; |
| 86 #endif |
| 87 |
| 84 // Returns true if the model has a match at the specified index. | 88 // Returns true if the model has a match at the specified index. |
| 85 bool HasMatchAt(size_t index) const; | 89 bool HasMatchAt(size_t index) const; |
| 86 | 90 |
| 87 // Returns the match at the specified index within the popup model. | 91 // Returns the match at the specified index within the popup model. |
| 88 const AutocompleteMatch& GetMatchAtIndex(size_t index) const; | 92 const AutocompleteMatch& GetMatchAtIndex(size_t index) const; |
| 89 | 93 |
| 90 // Fill a path for the contents' roundrect. |bounding_rect| is the rect that | 94 // Fill a path for the contents' roundrect. |bounding_rect| is the rect that |
| 91 // bounds the path. | 95 // bounds the path. |
| 92 void MakeContentsPath(gfx::Path* path, const gfx::Rect& bounding_rect); | 96 void MakeContentsPath(gfx::Path* path, const gfx::Rect& bounding_rect); |
| 93 | 97 |
| 94 // Updates the window's blur region for the current size. | 98 // Updates the window's blur region for the current size. |
| 95 void UpdateBlurRegion(); | 99 void UpdateBlurRegion(); |
| 96 | 100 |
| 97 // Makes the contents of the canvas slightly transparent. | 101 // Makes the contents of the canvas slightly transparent. |
| 98 void MakeCanvasTransparent(gfx::Canvas* canvas); | 102 void MakeCanvasTransparent(gfx::Canvas* canvas); |
| 99 | 103 |
| 100 #if defined(OS_WIN) | |
| 101 // The popup that contains this view. | 104 // The popup that contains this view. |
| 102 scoped_ptr<AutocompletePopupWin> popup_; | 105 scoped_ptr<AutocompletePopupClass> popup_; |
| 103 #endif | |
| 104 | 106 |
| 105 // The provider of our result set. | 107 // The provider of our result set. |
| 106 scoped_ptr<AutocompletePopupModel> model_; | 108 scoped_ptr<AutocompletePopupModel> model_; |
| 107 | 109 |
| 108 // The edit view that invokes us. | 110 // The edit view that invokes us. |
| 109 AutocompleteEditViewWin* edit_view_; | 111 AutocompleteEditViewWin* edit_view_; |
| 110 | 112 |
| 111 // An object that tells the popup how to position itself. | 113 // An object that tells the popup how to position itself. |
| 112 AutocompletePopupPositioner* popup_positioner_; | 114 AutocompletePopupPositioner* popup_positioner_; |
| 113 | 115 |
| 114 // The font that we should use for result rows. This is based on the font used | 116 // The font that we should use for result rows. This is based on the font used |
| 115 // by the edit that created us. | 117 // by the edit that created us. |
| 116 gfx::Font result_font_; | 118 gfx::Font result_font_; |
| 117 | 119 |
| 118 // The popup sizes vertically using an animation when the popup is getting | 120 // The popup sizes vertically using an animation when the popup is getting |
| 119 // shorter (not larger, that makes it look "slow"). | 121 // shorter (not larger, that makes it look "slow"). |
| 120 SlideAnimation size_animation_; | 122 SlideAnimation size_animation_; |
| 121 gfx::Rect start_bounds_; | 123 gfx::Rect start_bounds_; |
| 122 gfx::Rect target_bounds_; | 124 gfx::Rect target_bounds_; |
| 123 | 125 |
| 124 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 126 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
| 125 }; | 127 }; |
| 126 | 128 |
| 127 | 129 |
| 128 #endif // #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS
_VIEW_H_ | 130 #endif // #ifndef CHROME_BROWSER_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS
_VIEW_H_ |
| OLD | NEW |