Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1048)

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.h

Issue 6609047: [linux_views][Win] spoof proof redesign infobar extension with tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cast stroke width. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fe3655bca5b8d9207b40140db7dffca18b398b5b..314a16a98116ad5e6cfc2f740d70c3cc726a7f32 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,10 +73,9 @@ 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);
+ // Overlap the previous view by this amount, vertically, so that
+ // this InfoBarView may draw its tab on top.
+ int vertical_overlap() const { return preferred_tab_height(); }
protected:
// The target height of the InfoBar, regardless of what its current height
@@ -134,21 +134,28 @@ 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 kTabStrokeWidth;
+ static const int kTabWidth;
+
+ friend class InfoBarBackground;
Peter Kasting 2011/03/07 20:14:30 Nit: If these need to be friends, we're doing some
Sheridan Rawlins 2011/03/08 01:38:19 Fixed by using views::View and casting to InfoBarV
+ friend class InfoBarContainer;
// views::View:
virtual AccessibilityTypes::Role GetAccessibleRole();
virtual gfx::Size GetPreferredSize();
+ virtual void OnBoundsChanged();
+ virtual void PaintChildren(gfx::Canvas* canvas);
// views::FocusChangeListener:
virtual void FocusWillChange(View* focused_before, View* focused_now);
@@ -156,6 +163,18 @@ class InfoBarView : public InfoBar,
// ui::AnimationDelegate:
virtual void AnimationEnded(const ui::Animation* animation);
+ // Use the same clip path as the |fill_path_|.
+ SkPath* clip_path() const { return fill_path_.get(); }
Peter Kasting 2011/03/07 20:14:30 Nit: Remove this function and call fill_path() dir
Sheridan Rawlins 2011/03/08 01:38:19 Done.
+ SkPath* fill_path() const { return fill_path_.get(); }
+ SkPath* stroke_path() const { return stroke_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;
Peter Kasting 2011/03/07 20:14:30 Nit: Use CamelCase because neither of these is a c
Sheridan Rawlins 2011/03/08 01:38:19 Choosing Animated instead of Preferred or Current,
+ int preferred_bar_height() const;
+
// Destroys the external focus tracker, if present. If |restore_focus| is
// true, restores focus to the view tracked by the focus tracker before doing
// so.
@@ -187,9 +206,12 @@ 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.
int target_height_;
+ scoped_ptr<SkPath> fill_path_;
+ scoped_ptr<SkPath> stroke_path_;
+
DISALLOW_COPY_AND_ASSIGN(InfoBarView);
};

Powered by Google App Engine
This is Rietveld 408576698