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

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: Addressed review comments 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
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button.cc ('k') | chrome/browser/ui/views/bubble/bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button.cc ('k') | chrome/browser/ui/views/bubble/bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698