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

Unified Diff: ui/views/bubble/bubble_border.h

Issue 454173002: Fixed BubbleBorder sizing problems & added unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Combined test fixtures and rewrote tests to be more easily maintained. Created 6 years, 4 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: ui/views/bubble/bubble_border.h
diff --git a/ui/views/bubble/bubble_border.h b/ui/views/bubble/bubble_border.h
index 15f0f85f60ddcae2a44a1f373ecc4dbb1320866f..3cdf02d336c6665bf437026823aa7a73e25df703 100644
--- a/ui/views/bubble/bubble_border.h
+++ b/ui/views/bubble/bubble_border.h
@@ -158,26 +158,45 @@ class VIEWS_EXPORT BubbleBorder : public Border {
virtual gfx::Rect GetBounds(const gfx::Rect& anchor_rect,
const gfx::Size& contents_size) const;
- // Get the border exterior thickness, including stroke and shadow, in pixels.
+ // Get the arrow thickness.
msw 2014/08/19 21:35:39 Expanding unit tests shouldn't expand BubbleBorder
bruthig 2014/08/20 15:01:28 The reason I didn't add a BorderImages* GetImagesF
msw 2014/08/20 20:41:02 Yeah, move the internal::BorderImages decl to this
bruthig 2014/08/22 19:45:04 Done.
+ int GetArrowThickness() const;
+
+ // Get the top arrow width.
+ int GetTopArrowWidth() const;
+
+ // Get the border thickness.
int GetBorderThickness() const;
+ // Get the border interior thickness.
+ int GetBorderInteriorThickness() const;
+
+ // Get the border exterior thickness, including stroke and shadow, in pixels.
+ int GetBorderExteriorThickness() const;
msw 2014/08/19 21:35:39 nit: revert this name change when you remove the a
bruthig 2014/08/22 19:45:04 Done.
+
// Returns the corner radius of the current image set.
int GetBorderCornerRadius() const;
// Gets the arrow offset to use.
int GetArrowOffset(const gfx::Size& border_size) const;
+ // Gets the arrow size to use.
+ int GetArrowSize() const;
+
// Overridden from Border:
virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE;
virtual gfx::Insets GetInsets() const OVERRIDE;
virtual gfx::Size GetMinimumSize() const OVERRIDE;
private:
+ friend class BubbleBorderTest;
+
gfx::Size GetSizeForContentsSize(const gfx::Size& contents_size) const;
gfx::ImageSkia* GetArrowImage() const;
gfx::Rect GetArrowRect(const gfx::Rect& bounds) const;
void DrawArrow(gfx::Canvas* canvas, const gfx::Rect& arrow_bounds) const;
+ // The border and arrow stroke size used in image assets, in pixels.
+ static const int kStroke;
msw 2014/08/19 21:35:39 statics should be declared before functions as per
bruthig 2014/08/22 19:45:04 Done.
Arrow arrow_;
int arrow_offset_;
ArrowPaintType arrow_paint_type_;

Powered by Google App Engine
This is Rietveld 408576698