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

Unified Diff: chrome/browser/ui/cocoa/infobars/infobar_controller.h

Issue 7981045: Make infobars ignore button clicks when closing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/ui/cocoa/infobars/infobar_controller.h
===================================================================
--- chrome/browser/ui/cocoa/infobars/infobar_controller.h (revision 102604)
+++ chrome/browser/ui/cocoa/infobars/infobar_controller.h (working copy)
@@ -48,15 +48,27 @@
- (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)owned;
Robert Sesek 2011/09/27 18:21:46 nit: this should probably be called -isOwned becau
Peter Kasting 2011/09/27 18:29:34 Done.
+
// 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 @@
@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

Powered by Google App Engine
This is Rietveld 408576698