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

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

Issue 1633403002: MacViews: Add native drop shadow to dialogs on OSX < 10.10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments. Removed native_widget_mac files. Created 4 years, 10 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 fac3a719a474b9771fda692b4fad20bfb99a868c..87c0318854512271c5c1150031f6e9e5e2060e9b 100644
--- a/ui/views/bubble/bubble_border.h
+++ b/ui/views/bubble/bubble_border.h
@@ -14,9 +14,12 @@
#include "ui/views/border.h"
namespace gfx {
+class Path;
class Rect;
}
+class SkPath;
tapted 2016/02/11 01:47:23 nit: I think this should appear above any forward
karandeepb 2016/02/11 04:16:04 Done.
+
namespace views {
class Painter;
@@ -204,6 +207,13 @@ class VIEWS_EXPORT BubbleBorder : public Border {
// Gets the arrow offset to use.
int GetArrowOffset(const gfx::Size& border_size) const;
+ // Retreives the arrow path given |view_bounds|. |view_bounds| should be in
+ // its own coordinates (origin at (0,0)).
tapted 2016/02/11 01:47:23 hm - perhaps we should just change GetArrowRect to
karandeepb 2016/02/11 04:16:04 Done.
+ // Returns false if |path| is unchanged, which is the case when there is no
+ // painted arrow.
+ // The returned path does not account for arrow stroke and shadow.
+ bool GetArrowPath(const gfx::Rect& view_bounds, gfx::Path* path) const;
+
// Overridden from Border:
void Paint(const View& view, gfx::Canvas* canvas) override;
gfx::Insets GetInsets() const override;
@@ -220,6 +230,8 @@ class VIEWS_EXPORT BubbleBorder : public Border {
gfx::Size GetSizeForContentsSize(const gfx::Size& contents_size) const;
gfx::ImageSkia* GetArrowImage() const;
gfx::Rect GetArrowRect(const gfx::Rect& bounds) const;
+ void GetArrowPathFromArrowBounds(const gfx::Rect& arrow_bounds,
+ SkPath* path) const;
void DrawArrow(gfx::Canvas* canvas, const gfx::Rect& arrow_bounds) const;
internal::BorderImages* GetImagesForTest() const;

Powered by Google App Engine
This is Rietveld 408576698