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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 341823005: Collects stats on how user interacts with the bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment. Created 6 years, 5 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
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..9e50d30619729c1ac89380637c1bd658bf3d7493 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"
@@ -68,7 +69,8 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins)
content_margins_(content_margins),
title_(NULL),
close_(NULL),
- titlebar_extra_view_(NULL) {
+ titlebar_extra_view_(NULL),
+ before_close_callback_(base::Closure()) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
title_ = new Label(base::string16(),
rb.GetFontList(ui::ResourceBundle::MediumFont));
@@ -238,8 +240,11 @@ void BubbleFrameView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
}
void BubbleFrameView::ButtonPressed(Button* sender, const ui::Event& event) {
- if (sender == close_)
+ if (sender == close_) {
+ if (!before_close_callback_.is_null())
+ before_close_callback_.Run();
GetWidget()->Close();
+ }
}
void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) {
« chrome/browser/ui/views/session_crashed_bubble_view.cc ('K') | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698