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

Unified Diff: chrome/browser/ui/views/bubble/bubble.h

Issue 8138019: Don't reopen avatar bubble view on second click (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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: 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);
};

Powered by Google App Engine
This is Rietveld 408576698