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 384c4fa46a8ddb4cbe788c33d71d769e75493e33..3f75d0591f9b76ee88d11f99dfa58be6db8e44f6 100644 |
| --- a/ui/views/bubble/bubble_frame_view.cc |
| +++ b/ui/views/bubble/bubble_frame_view.cc |
| @@ -6,6 +6,7 @@ |
| #include <algorithm> |
| +#include "base/bind.h" |
| #include "grit/ui_resources.h" |
| #include "ui/base/hit_test.h" |
| #include "ui/base/resource/resource_bundle.h" |
| @@ -50,6 +51,9 @@ int GetOffScreenLength(const gfx::Rect& available_bounds, |
| std::max(0, window_bounds.right() - available_bounds.right()); |
| } |
| +// The default value for callback_before_close_. |
| +void EmptyCallback() {} |
| + |
| } // namespace |
| namespace views { |
| @@ -68,7 +72,8 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins) |
| content_margins_(content_margins), |
| title_(NULL), |
| close_(NULL), |
| - titlebar_extra_view_(NULL) { |
| + titlebar_extra_view_(NULL), |
| + callback_before_close_(base::Bind(&EmptyCallback)) { |
|
Alexei Svitkine (slow)
2014/07/02 15:07:26
I think you can initialize it with the default cto
yao
2014/07/07 17:47:45
Done.
|
| ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| title_ = new Label(base::string16(), |
| rb.GetFontList(ui::ResourceBundle::MediumFont)); |
| @@ -238,8 +243,10 @@ void BubbleFrameView::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| } |
| void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) { |
| - if (sender == close_) |
| + if (sender == close_) { |
| + callback_before_close_.Run(); |
| GetWidget()->Close(); |
| + } |
| } |
| void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) { |