Chromium Code Reviews| Index: ui/views/bubble/bubble_frame_view.cc |
| diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc |
| index 3e63de96a220a0eac2563d6fa2a896b96b7f7cc3..6872b0b662e08da9743e79ce09d090e7008c2ead 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,14 @@ 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(); |
| + path->addRoundRect(gfx::RectToSkRect(gfx::Rect(gfx::Point(), size)), radius, |
|
msw
2016/03/22 18:42:45
nit: use gfx::Rect(size))
Evan Stade
2016/03/22 20:00:45
Done.
|
| + radius); |
| + return true; |
| +} |
| + |
| int BubbleFrameView::NonClientHitTest(const gfx::Point& point) { |
| if (!bounds().Contains(point)) |
| return HTNOWHERE; |
| @@ -217,6 +227,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 +331,6 @@ void BubbleFrameView::Layout() { |
| } |
| } |
| -const char* BubbleFrameView::GetClassName() const { |
| - return kViewClassName; |
| -} |
| - |
| void BubbleFrameView::OnThemeChanged() { |
| UpdateWindowTitle(); |
| ResetWindowControls(); |
| @@ -335,6 +345,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; |