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

Unified Diff: chrome/browser/infobars/infobar_manager.h

Issue 228293004: InfoBarService inherits from InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a ShutDown method Created 6 years, 8 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/infobars/infobar_manager.h
diff --git a/chrome/browser/infobars/infobar_manager.h b/chrome/browser/infobars/infobar_manager.h
index 756601080db3c71e34c7f16a61a8cdfaa3dea8c2..377182e392896065f2c6f52cb22c37fb9e656c6c 100644
--- a/chrome/browser/infobars/infobar_manager.h
+++ b/chrome/browser/infobars/infobar_manager.h
@@ -32,7 +32,10 @@ class InfoBarManager {
};
explicit InfoBarManager(content::WebContents* web_contents);
- ~InfoBarManager();
+ virtual ~InfoBarManager();
+
+ // Must be called before destruction.
+ void ShutDown();
droger 2014/04/08 15:00:11 This method is needed as there are virtual calls d
Peter Kasting 2014/04/08 20:39:56 I'd add a comment to that effect.
// Adds the specified |infobar|, which already owns a delegate.
//
@@ -42,7 +45,7 @@ class InfoBarManager {
// immediately without being added.
//
// Returns the infobar if it was successfully added.
- virtual InfoBar* AddInfoBar(scoped_ptr<InfoBar> infobar);
+ InfoBar* AddInfoBar(scoped_ptr<InfoBar> infobar);
// Removes the specified |infobar|. This in turn may close immediately or
// animate closed; at the end the infobar will delete itself.
@@ -90,6 +93,14 @@ class InfoBarManager {
void AddObserver(Observer* obs);
void RemoveObserver(Observer* obs);
+ protected:
+ // Notifies the observer in |observer_list_|.
+ virtual void NotifyInfoBarAdded(InfoBar* infobar);
+ virtual void NotifyInfoBarRemoved(InfoBar* infobar, bool animate);
+ virtual void NotifyInfoBarReplaced(InfoBar* old_infobar,
+ InfoBar* new_infobar);
+ void NotifyManagerShuttingDown();
+
private:
// InfoBars associated with this InfoBarManager. We own these pointers.
// However, this is not a ScopedVector, because we don't delete the infobars
@@ -102,6 +113,7 @@ class InfoBarManager {
InfoBars infobars_;
bool infobars_enabled_;
+ bool did_shut_down_;
// TODO(droger): remove this field. See http://crbug.com/354379.
content::WebContents* web_contents_;

Powered by Google App Engine
This is Rietveld 408576698