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

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

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
Index: ui/views/bubble/bubble_frame_view.h
diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h
index a17a4f8f487eede0823a540e7654ceee3544b2cd..9413a9d78a099c56e00cfac7e7112cfe328c58b2 100644
--- a/ui/views/bubble/bubble_frame_view.h
+++ b/ui/views/bubble/bubble_frame_view.h
@@ -6,6 +6,7 @@
#define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "ui/gfx/insets.h"
@@ -79,6 +80,8 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
gfx::Size client_size,
bool adjust_if_offscreen);
+ void SetCloseCallback(base::Closure c) {callback_before_close_ = c;}
Alexei Svitkine (slow) 2014/07/02 15:07:26 This should use hacker_style (i.e. set_before_clos
yao 2014/07/07 17:47:45 Done.
+
protected:
// Returns the available screen bounds if the frame were to show in |rect|.
virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect);
@@ -114,6 +117,10 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
// (x) close button.
View* titlebar_extra_view_;
+ // The callback function is executed before bubble is closed. It can be used
+ // to customize bubble's close behavior.
+ base::Closure callback_before_close_;
Alexei Svitkine (slow) 2014/07/02 15:07:26 Nit: Rename to before_close_callback_
yao 2014/07/07 17:47:45 Done.
+
DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
};

Powered by Google App Engine
This is Rietveld 408576698