summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bubble_controller.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bubble_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bubble_controller.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm
index b8ae9c5..43f996b 100644
--- a/chrome/browser/cocoa/bookmark_bubble_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm
@@ -17,9 +17,10 @@
@implementation ChooseAnotherFolder
@end
-@interface BookmarkBubbleController ()
+@interface BookmarkBubbleController (PrivateAPI)
- (void)updateBookmarkNode;
- (void)fillInFolderList;
+- (void)parentWindowWillClose:(NSNotification*)notification;
@end
@implementation BookmarkBubbleController
@@ -54,7 +55,7 @@
// Watch to see if the parent window closes, and if so, close this one.
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
[center addObserver:self
- selector:@selector(windowWillClose:)
+ selector:@selector(parentWindowWillClose:)
name:NSWindowWillCloseNotification
object:parentWindow_];
}
@@ -66,7 +67,13 @@
[super dealloc];
}
-- (void)windowWillClose:(NSNotification *)notification {
+- (void)parentWindowWillClose:(NSNotification*)notification {
+ [self close];
+}
+
+- (void)windowWillClose:(NSNotification*)notification {
+ // We caught a close so we don't need to watch for the parent closing.
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
[self autorelease];
}