Index: chrome/browser/ui/views/bubble/bubble.h |
diff --git a/chrome/browser/ui/views/bubble/bubble.h b/chrome/browser/ui/views/bubble/bubble.h |
index fcd6d60b59f369c9f81d88bfbd8b9b07f5917acc..559c5929786c79d27fe4623b18939d543a1bec93 100644 |
--- a/chrome/browser/ui/views/bubble/bubble.h |
+++ b/chrome/browser/ui/views/bubble/bubble.h |
@@ -6,6 +6,7 @@ |
#define CHROME_BROWSER_UI_VIEWS_BUBBLE_BUBBLE_H_ |
#pragma once |
+#include "base/observer_list.h" |
#include "views/bubble/bubble_border.h" |
#include "ui/base/animation/animation_delegate.h" |
#include "views/accelerator.h" |
@@ -86,6 +87,12 @@ class Bubble |
public views::AcceleratorTarget, |
public ui::AnimationDelegate { |
public: |
+ class Observer { |
+ public: |
+ // See BubbleDelegate::BubbleClosing for when this is called. |
+ virtual void OnBubbleClosing(Bubble* bubble, bool closed_by_escape) = 0; |
Peter Kasting
2011/10/05 01:22:51
Nit: You don't seem to use either of these args, s
sail
2011/10/05 01:32:10
Done.
|
+ }; |
+ |
// Shows the Bubble. |
// |parent| is set as the parent window. |
// |contents| are the contents shown in the bubble. |
@@ -144,6 +151,14 @@ class Bubble |
views::View* contents() const { return contents_; } |
#endif |
+ void AddObserver(Observer* obs) { |
+ observer_list_.AddObserver(obs); |
+ } |
+ |
+ void RemoveObserver(Observer* obs) { |
+ observer_list_.RemoveObserver(obs); |
+ } |
+ |
static const SkColor kBackgroundColor; |
protected: |
@@ -243,6 +258,8 @@ class Bubble |
bool accelerator_registered_; |
+ ObserverList<Observer> observer_list_; |
+ |
DISALLOW_COPY_AND_ASSIGN(Bubble); |
}; |