Chromium Code Reviews| 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_; |