Chromium Code Reviews| Index: chrome/browser/ui/views/infobars/infobar_view.h |
| diff --git a/chrome/browser/ui/views/infobars/infobar_view.h b/chrome/browser/ui/views/infobars/infobar_view.h |
| index dbe847f37fd6c1c3e9983f4e0fb8d662bd11ae0d..fb31073317963b7b2f81233f021a6f6f9b69dcdf 100644 |
| --- a/chrome/browser/ui/views/infobars/infobar_view.h |
| +++ b/chrome/browser/ui/views/infobars/infobar_view.h |
| @@ -13,6 +13,7 @@ |
| class InfoBarContainer; |
| class InfoBarDelegate; |
| +class SkPath; |
| namespace ui { |
| class SlideAnimation; |
| @@ -72,11 +73,6 @@ class InfoBarView : public InfoBar, |
| // is called. |
| void Close(); |
| - // Paint the arrow on |canvas|. |arrow_center_x| indicates the |
| - // desired location of the center of the arrow in the |outer_view| |
| - // coordinate system. |
| - void PaintArrow(gfx::Canvas* canvas, View* outer_view, int arrow_center_x); |
| - |
| protected: |
| // The target height of the InfoBar, regardless of what its current height |
| // is (due to animation). |
| @@ -128,7 +124,12 @@ class InfoBarView : public InfoBar, |
| void set_target_height(int height) { target_height_ = height; } |
| - ui::SlideAnimation* animation() { return animation_.get(); } |
| + // To allow different animations, proxy needed routines for |
|
Peter Kasting
2011/03/04 22:23:42
Based on my chat with Ben and you, let's just do a
Sheridan Rawlins
2011/03/05 18:06:54
Done.
|
| + // subclasses, rather than exposing the |animation_| object. |
| + void AnimationReset(double value = 0.0); |
| + void AnimationShow(); |
| + void AnimationHide(); |
| + void AnimationStop(); |
| // These return x coordinates delimiting the usable area for subclasses to lay |
| // out their controls. |
| @@ -136,21 +137,38 @@ class InfoBarView : public InfoBar, |
| int EndX() const; |
| // Returns a centered y-position of a control of height specified in |
| - // |prefsize| within the standard InfoBar height. Stable during an animation. |
| - int CenterY(const gfx::Size prefsize) const; |
| - |
| - // Returns a centered y-position of a control of height specified in |
| // |prefsize| within the standard InfoBar height, adjusted according to the |
| // current amount of animation offset the |parent| InfoBar currently has. |
| // Changes during an animation. |
| int OffsetY(const gfx::Size prefsize) const; |
| private: |
| + static const int kTabPadding; |
| + static const int kCurveDistance; |
| static const int kHorizontalPadding; |
| + static const int kIconWidth; |
| + static const int kTabHeight; |
| + static const int kTabWidth; |
| + |
| + friend class InfoBarBackground; |
| + friend class InfoBarContainer; |
| + |
| + SkPath* fill_path() const { return fill_path_.get(); } |
|
Peter Kasting
2011/03/04 22:23:42
Nit: Put non-virtual functions below the virtual o
Sheridan Rawlins
2011/03/05 18:06:54
Done.
|
| + SkPath* stroke_path() const { return stroke_path_.get(); } |
| + SkPath* clip_path() const { return clip_path_.get(); } |
| + |
| + // Returns a centered y-position of a control of height specified in |
| + // |prefsize| within the standard InfoBar height. Stable during an animation. |
| + int CenterY(const gfx::Size prefsize) const; |
| + |
| + int preferred_tab_height() const; |
| + int preferred_bar_height() const; |
| // views::View: |
| virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| virtual gfx::Size GetPreferredSize() OVERRIDE; |
| + virtual void OnBoundsChanged() OVERRIDE; |
| + virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
| // views::FocusChangeListener: |
| virtual void FocusWillChange(View* focused_before, View* focused_now) |
| @@ -180,8 +198,9 @@ class InfoBarView : public InfoBar, |
| // The close button at the right edge of the InfoBar. |
| views::ImageButton* close_button_; |
| - // The animation that runs when the InfoBar is opened or closed. |
| - scoped_ptr<ui::SlideAnimation> animation_; |
| + // The animations that run when the InfoBar is opened or closed. |
| + scoped_ptr<ui::SlideAnimation> tab_animation_; |
| + scoped_ptr<ui::SlideAnimation> bar_animation_; |
| // Tracks and stores the last focused view which is not the InfoBar or any of |
| // its children. Used to restore focus once the InfoBar is closed. |
| @@ -190,9 +209,18 @@ class InfoBarView : public InfoBar, |
| // Used to delete this object after a return to the message loop. |
| ScopedRunnableMethodFactory<InfoBarView> delete_factory_; |
| - // The target height for the InfoBarView. |
| + // The target height for the bar portion of the InfoBarView. |
|
Peter Kasting
2011/03/04 22:23:42
Nit: Extra space
Sheridan Rawlins
2011/03/05 18:06:54
Done.
|
| int target_height_; |
| + // The current stroke path of the InfoBar. |
|
Peter Kasting
2011/03/04 22:23:42
Nit: These comments add nothing. Just eliminate t
Sheridan Rawlins
2011/03/05 18:06:54
Done.
|
| + scoped_ptr<SkPath> stroke_path_; |
| + |
| + // The current fill path of the InfoBar. |
| + scoped_ptr<SkPath> fill_path_; |
| + |
| + // The current clip path of the InfoBar. |
| + scoped_ptr<SkPath> clip_path_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(InfoBarView); |
| }; |