summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/infobars/infobar_controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/cocoa/infobars/infobar_controller.h')
-rw-r--r--chrome/browser/ui/cocoa/infobars/infobar_controller.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.h b/chrome/browser/ui/cocoa/infobars/infobar_controller.h
index b5d080d..32e5633 100644
--- a/chrome/browser/ui/cocoa/infobars/infobar_controller.h
+++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.h
@@ -48,15 +48,27 @@ class TabContentsWrapper;
- (id)initWithDelegate:(InfoBarDelegate*)delegate
owner:(TabContentsWrapper*)owner;
+// Returns YES if the infobar is owned. If this is NO, it is not safe to call
+// any delegate functions, since they might attempt to access the owner. Code
+// should generally just do nothing at all in this case (once we're closing, all
+// controls can safely just go dead).
+- (BOOL)isOwned;
+
// Called when someone clicks on the OK or Cancel buttons. Subclasses
// must override if they do not hide the buttons.
- (void)ok:(id)sender;
- (void)cancel:(id)sender;
-// Called when someone clicks on the close button. Dismisses the
-// infobar without taking any action.
+// Called when someone clicks on the close button. Dismisses the infobar
+// without taking any action.
+// NOTE: Subclasses should not call this to close the infobar as it will lead to
+// errors in stat counting. Call -removeSelf instead.
- (IBAction)dismiss:(id)sender;
+// Asks the container controller to remove the infobar for this delegate. This
+// call will trigger a notification that starts the infobar animating closed.
+- (void)removeSelf;
+
// Returns a pointer to this controller's view, cast as an AnimatableView.
- (AnimatableView*)animatableView;
@@ -86,6 +98,12 @@ class TabContentsWrapper;
@end
+@interface InfoBarController (Protected)
+// Closes and disables the provided menu. Subclasses should call this for each
+// popup menu in -infobarWillClose.
+- (void)disablePopUpMenu:(NSMenu*)menu;
+@end
+
/////////////////////////////////////////////////////////////////////////
// InfoBarController subclasses, one for each InfoBarDelegate
// subclass. Each of these subclasses overrides addAdditionalControls to