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

Unified Diff: chrome/browser/views/bubble_border.cc

Issue 259065: Add an BubbleBorder to BrowserAction popups and fix positioning of the (Closed)
Patch Set: cleanup Created 11 years, 2 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 | « chrome/browser/views/bubble_border.h ('k') | chrome/browser/views/extensions/extension_popup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bubble_border.cc
diff --git a/chrome/browser/views/bubble_border.cc b/chrome/browser/views/bubble_border.cc
index 9796a46da3a9200cf1aae6fb9750e152a7fbc7a5..3c1898378d420b436578ad97ad457415d82dd769 100644
--- a/chrome/browser/views/bubble_border.cc
+++ b/chrome/browser/views/bubble_border.cc
@@ -265,3 +265,22 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const {
width - bl_width - br_width, b_height);
}
}
+
+/////////////////////////
+
+void BubbleBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
+ // The border of this view creates an anti-aliased round-rect region for the
+ // contents, which we need to fill with the background color.
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setColor(border_->background_color());
+ gfx::Path path;
+ gfx::Rect bounds(view->GetLocalBounds(false));
+ SkRect rect;
+ rect.set(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()),
+ SkIntToScalar(bounds.right()), SkIntToScalar(bounds.bottom()));
+ SkScalar radius = SkIntToScalar(BubbleBorder::GetCornerRadius());
+ path.addRoundRect(rect, radius, radius);
+ canvas->drawPath(path, paint);
+}
« no previous file with comments | « chrome/browser/views/bubble_border.h ('k') | chrome/browser/views/extensions/extension_popup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698