diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-06 23:50:06 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-06 23:50:06 +0000 |
commit | ab4707af48416b411021b27e67b67270f3caec10 (patch) | |
tree | d4866a942d81d3a77d606be5c9132bfc14f6d3b8 /chrome/browser/views/bubble_border.cc | |
parent | 7e5eb1cf0839ad0c6db1a3e1a682bdfd738783b9 (diff) | |
download | chromium_src-ab4707af48416b411021b27e67b67270f3caec10.zip chromium_src-ab4707af48416b411021b27e67b67270f3caec10.tar.gz chromium_src-ab4707af48416b411021b27e67b67270f3caec10.tar.bz2 |
Add an BubbleBorder to BrowserAction popups and fix positioning of the
popup.
BUG=23833,23835
TEST=none
Review URL: http://codereview.chromium.org/259065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28187 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bubble_border.cc')
-rw-r--r-- | chrome/browser/views/bubble_border.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/views/bubble_border.cc b/chrome/browser/views/bubble_border.cc index 9796a46..3c18983 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); +} |