| Index: views/bubble/bubble_border.h
|
| diff --git a/views/bubble/bubble_border.h b/views/bubble/bubble_border.h
|
| index edca71e0b6ce17581c96f5002e0617d7dc6506c6..2ed579cb11737f3a0927ea4ae32f3ac5ab301100 100644
|
| --- a/views/bubble/bubble_border.h
|
| +++ b/views/bubble/bubble_border.h
|
| @@ -34,6 +34,41 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
|
| FLOAT = 9 // No arrow. Centered over the supplied rect.
|
| };
|
|
|
| + enum Shadow {
|
| + SHADOW = 0,
|
| + NO_SHADOW = 1
|
| + };
|
| +
|
| + struct BorderImages {
|
| + BorderImages()
|
| + : left(NULL),
|
| + top_left(NULL),
|
| + top(NULL),
|
| + top_right(NULL),
|
| + right(NULL),
|
| + bottom_right(NULL),
|
| + bottom(NULL),
|
| + bottom_left(NULL),
|
| + left_arrow(NULL),
|
| + top_arrow(NULL),
|
| + right_arrow(NULL),
|
| + bottom_arrow(NULL) {
|
| + }
|
| +
|
| + SkBitmap* left;
|
| + SkBitmap* top_left;
|
| + SkBitmap* top;
|
| + SkBitmap* top_right;
|
| + SkBitmap* right;
|
| + SkBitmap* bottom_right;
|
| + SkBitmap* bottom;
|
| + SkBitmap* bottom_left;
|
| + SkBitmap* left_arrow;
|
| + SkBitmap* top_arrow;
|
| + SkBitmap* right_arrow;
|
| + SkBitmap* bottom_arrow;
|
| + };
|
| +
|
| // The position of the bubble in relation to the anchor.
|
| enum BubbleAlignment {
|
| // The tip of the arrow points to the middle of the anchor.
|
| @@ -42,13 +77,7 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
|
| ALIGN_EDGE_TO_ANCHOR_EDGE
|
| };
|
|
|
| - explicit BubbleBorder(ArrowLocation arrow_location)
|
| - : override_arrow_offset_(0),
|
| - arrow_location_(arrow_location),
|
| - alignment_(ALIGN_ARROW_TO_MID_ANCHOR),
|
| - background_color_(SK_ColorWHITE) {
|
| - InitClass();
|
| - }
|
| + BubbleBorder(ArrowLocation arrow_location, Shadow shadow);
|
|
|
| // Returns the radius of the corner of the border.
|
| static int GetCornerRadius() {
|
| @@ -118,7 +147,7 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
|
|
|
| private:
|
| // Loads images if necessary.
|
| - static void InitClass();
|
| + static BorderImages* GetBorderImages(Shadow shadow);
|
|
|
| virtual ~BubbleBorder();
|
|
|
| @@ -143,21 +172,14 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
|
| int shift_y) const;
|
|
|
| // Border graphics.
|
| - static SkBitmap* left_;
|
| - static SkBitmap* top_left_;
|
| - static SkBitmap* top_;
|
| - static SkBitmap* top_right_;
|
| - static SkBitmap* right_;
|
| - static SkBitmap* bottom_right_;
|
| - static SkBitmap* bottom_;
|
| - static SkBitmap* bottom_left_;
|
| - static SkBitmap* left_arrow_;
|
| - static SkBitmap* top_arrow_;
|
| - static SkBitmap* right_arrow_;
|
| - static SkBitmap* bottom_arrow_;
|
| + struct BorderImages* images_;
|
| +
|
| + // Image bundles.
|
| + static struct BorderImages* normal_images_;
|
| + static struct BorderImages* shadow_images_;
|
|
|
| // Minimal offset of the arrow from the closet edge of bounding rect.
|
| - static int arrow_offset_;
|
| + int arrow_offset_;
|
|
|
| // If specified, overrides the pre-calculated |arrow_offset_| of the arrow.
|
| int override_arrow_offset_;
|
|
|