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

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: Nits Created 6 years, 6 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
« ui/views/bubble/bubble_frame_view.h ('K') | « ui/views/bubble/bubble_frame_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« ui/views/bubble/bubble_frame_view.h ('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