diff options
Diffstat (limited to 'ui/views/bubble/bubble_frame_view.cc')
| -rw-r--r-- | ui/views/bubble/bubble_frame_view.cc | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index 3e63de9..4c342a5 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc @@ -12,6 +12,8 @@ #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/compositor/paint_context.h" +#include "ui/compositor/paint_recorder.h" #include "ui/gfx/geometry/vector2d.h" #include "ui/gfx/path.h" #include "ui/gfx/screen.h" @@ -134,6 +136,15 @@ gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds( return bubble_border_->GetBounds(gfx::Rect(), size); } +bool BubbleFrameView::GetClientMask(const gfx::Size& size, + gfx::Path* path) const { + const int radius = bubble_border_->GetBorderCornerRadius(); + gfx::RectF rect((gfx::Rect(size))); + rect.Inset(gfx::InsetsF(0.5f)); + path->addRoundRect(gfx::RectFToSkRect(rect), radius, radius); + return true; +} + int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { if (!bounds().Contains(point)) return HTNOWHERE; @@ -217,6 +228,10 @@ void BubbleFrameView::SetTitleFontList(const gfx::FontList& font_list) { title_->SetFontList(font_list); } +const char* BubbleFrameView::GetClassName() const { + return kViewClassName; +} + gfx::Insets BubbleFrameView::GetInsets() const { gfx::Insets insets = content_margins_; @@ -317,10 +332,6 @@ void BubbleFrameView::Layout() { } } -const char* BubbleFrameView::GetClassName() const { - return kViewClassName; -} - void BubbleFrameView::OnThemeChanged() { UpdateWindowTitle(); ResetWindowControls(); @@ -335,6 +346,19 @@ void BubbleFrameView::OnNativeThemeChanged(const ui::NativeTheme* theme) { } } +void BubbleFrameView::OnPaint(gfx::Canvas* canvas) { + OnPaintBackground(canvas); + // Border comes after children. +} + +void BubbleFrameView::PaintChildren(const ui::PaintContext& context) { + NonClientFrameView::PaintChildren(context); + + ui::PaintCache paint_cache; + ui::PaintRecorder recorder(context, size(), &paint_cache); + OnPaintBorder(recorder.canvas()); +} + void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { if (sender == close_) { close_button_clicked_ = true; |
