| Index: chrome/browser/tab_contents/infobar_delegate.h
|
| ===================================================================
|
| --- chrome/browser/tab_contents/infobar_delegate.h (revision 84141)
|
| +++ chrome/browser/tab_contents/infobar_delegate.h (working copy)
|
| @@ -28,23 +28,6 @@
|
| // does not map to a specific InfoBar type. Instead, you must implement either
|
| // LinkInfoBarDelegate or ConfirmInfoBarDelegate, or override with your own
|
| // delegate for your own InfoBar variety.
|
| -//
|
| -// --- WARNING ---
|
| -// When creating your InfoBarDelegate subclass, it is recommended that you
|
| -// design it such that you instantiate a brand new delegate for every call to
|
| -// AddInfoBar, rather than re-using/sharing a delegate object. Otherwise,
|
| -// you need to consider the fact that more than one InfoBar instance can exist
|
| -// and reference the same delegate -- even though it is also true that we only
|
| -// ever fully show one infobar (they don't stack). The dual-references occur
|
| -// because a second InfoBar can be added while the first one is in the process
|
| -// of closing (the animations). This can cause problems because when the first
|
| -// one does finally fully close InfoBarDelegate::InfoBarClosed() is called,
|
| -// and the delegate is free to clean itself up or reset state, which may have
|
| -// fatal consequences for the InfoBar that was in the process of opening (or is
|
| -// now fully opened) -- it is referencing a delegate that may not even exist
|
| -// anymore.
|
| -// As such, it is generally much safer to dedicate a delegate instance to
|
| -// AddInfoBar!
|
| class InfoBarDelegate {
|
| public:
|
| // The type of the infobar. It controls its appearance, such as its background
|
| @@ -77,9 +60,9 @@
|
| // Called when the user clicks on the close button to dismiss the infobar.
|
| virtual void InfoBarDismissed();
|
|
|
| - // Called after the InfoBar is closed. The delegate is free to delete itself
|
| - // at this point.
|
| - virtual void InfoBarClosed();
|
| + // Called after the InfoBar is closed. Deletes |this|.
|
| + // TODO(pkasting): Get rid of this and delete delegates directly.
|
| + void InfoBarClosed();
|
|
|
| // Return the icon to be shown for this InfoBar. If the returned Image is
|
| // NULL, no icon is shown.
|
|
|