| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Overridden from AutocompleteResultViewModel: | 62 // Overridden from AutocompleteResultViewModel: |
| 63 virtual bool IsSelectedIndex(size_t index) const; | 63 virtual bool IsSelectedIndex(size_t index) const; |
| 64 virtual bool IsHoveredIndex(size_t index) const; | 64 virtual bool IsHoveredIndex(size_t index) const; |
| 65 virtual const SkBitmap* GetSpecialIcon(size_t index) const; | 65 virtual const SkBitmap* GetSpecialIcon(size_t index) const; |
| 66 | 66 |
| 67 // Overridden from ui::AnimationDelegate: | 67 // Overridden from ui::AnimationDelegate: |
| 68 virtual void AnimationProgressed(const ui::Animation* animation); | 68 virtual void AnimationProgressed(const ui::Animation* animation); |
| 69 | 69 |
| 70 // Overridden from views::View: | 70 // Overridden from views::View: |
| 71 virtual void OnPaint(gfx::Canvas* canvas); | 71 virtual void OnPaint(gfx::Canvas* canvas); |
| 72 virtual void PaintChildren(gfx::CanvasSkia* canvas); | 72 |
| 73 // This method should not be triggered directly as we paint our children |
| 74 // in an un-conventional way inside OnPaint. We use a separate canvas to |
| 75 // paint the children. Hence we override this method to a no-op so that |
| 76 // the view hierarchy doesnot "accidentally" trigger this. |
| 77 virtual void PaintChildren(gfx::Canvas* canvas); |
| 73 virtual void Layout(); | 78 virtual void Layout(); |
| 74 virtual void LayoutChildren(); | 79 virtual void LayoutChildren(); |
| 75 virtual void OnMouseEntered(const views::MouseEvent& event); | 80 virtual void OnMouseEntered(const views::MouseEvent& event); |
| 76 virtual void OnMouseMoved(const views::MouseEvent& event); | 81 virtual void OnMouseMoved(const views::MouseEvent& event); |
| 77 virtual void OnMouseExited(const views::MouseEvent& event); | 82 virtual void OnMouseExited(const views::MouseEvent& event); |
| 78 virtual bool OnMousePressed(const views::MouseEvent& event); | 83 virtual bool OnMousePressed(const views::MouseEvent& event); |
| 79 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | 84 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); |
| 80 virtual bool OnMouseDragged(const views::MouseEvent& event); | 85 virtual bool OnMouseDragged(const views::MouseEvent& event); |
| 81 virtual views::View* GetViewForPoint(const gfx::Point& point); | 86 virtual views::View* GetViewForPoint(const gfx::Point& point); |
| 82 | 87 |
| 83 protected: | 88 protected: |
| 89 virtual void PaintResultViews(gfx::CanvasSkia* canvas); |
| 90 |
| 84 // Calculates the height needed to show all the results in the model. | 91 // Calculates the height needed to show all the results in the model. |
| 85 virtual int CalculatePopupHeight(); | 92 virtual int CalculatePopupHeight(); |
| 86 virtual AutocompleteResultView* CreateResultView( | 93 virtual AutocompleteResultView* CreateResultView( |
| 87 AutocompleteResultViewModel* model, | 94 AutocompleteResultViewModel* model, |
| 88 int model_index, | 95 int model_index, |
| 89 const gfx::Font& font, | 96 const gfx::Font& font, |
| 90 const gfx::Font& bold_font); | 97 const gfx::Font& bold_font); |
| 91 | 98 |
| 92 scoped_ptr<AutocompletePopupModel> model_; | 99 scoped_ptr<AutocompletePopupModel> model_; |
| 93 | 100 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // The popup sizes vertically using an animation when the popup is getting | 174 // The popup sizes vertically using an animation when the popup is getting |
| 168 // shorter (not larger, that makes it look "slow"). | 175 // shorter (not larger, that makes it look "slow"). |
| 169 ui::SlideAnimation size_animation_; | 176 ui::SlideAnimation size_animation_; |
| 170 gfx::Rect start_bounds_; | 177 gfx::Rect start_bounds_; |
| 171 gfx::Rect target_bounds_; | 178 gfx::Rect target_bounds_; |
| 172 | 179 |
| 173 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); | 180 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupContentsView); |
| 174 }; | 181 }; |
| 175 | 182 |
| 176 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ | 183 #endif // CHROME_BROWSER_UI_VIEWS_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_CONTENTS_VIEW
_H_ |
| OLD | NEW |