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..9d61666603763a9faa3af5399c713538626d7fae 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() = 0; |
+ }; |
+ |
// 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); |
}; |