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

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. 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
« no previous file with comments | « ui/gfx/path_mac_unittest.mm ('k') | ui/views/bubble/bubble_border.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fd3b7c576dd99899817c9672d6ea3a733fca3c34 100644
--- a/ui/views/bubble/bubble_border.h
+++ b/ui/views/bubble/bubble_border.h
@@ -13,7 +13,10 @@
#include "ui/views/background.h"
#include "ui/views/border.h"
+class SkPath;
+
namespace gfx {
+class Path;
class Rect;
}
@@ -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 local
+ // bounds of the view.
+ // 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;
« no previous file with comments | « ui/gfx/path_mac_unittest.mm ('k') | ui/views/bubble/bubble_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698