| Index: ui/views/bubble/bubble_border.cc
|
| diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc
|
| index 2538b73dd3c677c99ab9e03f1503d1b319df64df..2e5e12b27421f79ba5a707b910f02e2f85664d91 100644
|
| --- a/ui/views/bubble/bubble_border.cc
|
| +++ b/ui/views/bubble/bubble_border.cc
|
| @@ -29,7 +29,8 @@ struct BubbleBorder::BorderImages {
|
| left_arrow(NULL),
|
| top_arrow(NULL),
|
| right_arrow(NULL),
|
| - bottom_arrow(NULL) {
|
| + bottom_arrow(NULL),
|
| + pixels_to_border(0) {
|
| }
|
|
|
| SkBitmap* left;
|
| @@ -44,6 +45,7 @@ struct BubbleBorder::BorderImages {
|
| SkBitmap* top_arrow;
|
| SkBitmap* right_arrow;
|
| SkBitmap* bottom_arrow;
|
| + int pixels_to_border;
|
| };
|
|
|
| // static
|
| @@ -202,6 +204,10 @@ void BubbleBorder::GetInsets(gfx::Insets* insets) const {
|
| insets->Set(top, left, bottom, right);
|
| }
|
|
|
| +int BubbleBorder::pixels_to_border() const {
|
| + return images_->pixels_to_border;
|
| +}
|
| +
|
| int BubbleBorder::SetArrowOffset(int offset, const gfx::Size& contents_size) {
|
| gfx::Size border_size(contents_size);
|
| gfx::Insets insets;
|
| @@ -232,6 +238,7 @@ BubbleBorder::BorderImages* BubbleBorder::GetBorderImages(Shadow shadow) {
|
| shadow_images_->top_arrow = new SkBitmap();
|
| shadow_images_->right_arrow = new SkBitmap();
|
| shadow_images_->bottom_arrow = new SkBitmap();
|
| + shadow_images_->pixels_to_border = 10;
|
| } else if (shadow == NO_SHADOW && normal_images_ == NULL) {
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| normal_images_ = new BorderImages();
|
| @@ -247,6 +254,7 @@ BubbleBorder::BorderImages* BubbleBorder::GetBorderImages(Shadow shadow) {
|
| normal_images_->top_arrow = rb.GetBitmapNamed(IDR_BUBBLE_T_ARROW);
|
| normal_images_->right_arrow = rb.GetBitmapNamed(IDR_BUBBLE_R_ARROW);
|
| normal_images_->bottom_arrow = rb.GetBitmapNamed(IDR_BUBBLE_B_ARROW);
|
| + normal_images_->pixels_to_border = 0;
|
| }
|
| return shadow == SHADOW ? shadow_images_ : normal_images_;
|
| }
|
| @@ -501,8 +509,10 @@ void BubbleBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
|
| gfx::Path path;
|
| gfx::Rect bounds(view->GetContentsBounds());
|
| SkRect rect;
|
| + int offset = border_->pixels_to_border();
|
| rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
|
| SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
|
| + rect.inset(-border_->pixels_to_border(), -border_->pixels_to_border());
|
| SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius());
|
| path.addRoundRect(rect, radius, radius);
|
| canvas->GetSkCanvas()->drawPath(path, paint);
|
|
|