Index: chrome/browser/ui/cocoa/base_bubble_controller.mm |
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm |
index c4f4cf19d93c9fb162300f13fa7923bc4213a0a7..e5a8a8a060d359315eb672cb9e880d62b2d1d3e9 100644 |
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm |
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm |
@@ -17,6 +17,7 @@ |
#import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" |
@interface BaseBubbleController (Private) |
+- (InfoBubbleWindow*)bubbleWindow; |
- (void)registerForNotifications; |
- (void)updateOriginFromAnchor; |
- (void)activateTabWithContents:(content::WebContents*)newContents |
@@ -114,6 +115,10 @@ |
[super dealloc]; |
} |
+- (InfoBubbleWindow*)bubbleWindow { |
+ return base::mac::ObjCCastStrict<InfoBubbleWindow>([self window]); |
+} |
+ |
- (void)registerForNotifications { |
NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
// Watch to see if the parent window closes, and if so, close this one. |
@@ -233,7 +238,7 @@ |
- (void)close { |
[self closeCleanup]; |
- [super close]; |
+ [[self bubbleWindow] animateClose]; |
} |
// The controller is the delegate of the window so it receives did resign key |
@@ -259,17 +264,13 @@ |
// so disable sharing parent key state. Share parent key state is only used |
// to enable the close/minimize/maximize buttons of the parent window when |
// the bubble has key state, so disabling it here is safe. |
- InfoBubbleWindow* bubbleWindow = |
- base::mac::ObjCCastStrict<InfoBubbleWindow>([self window]); |
- [bubbleWindow setAllowShareParentKeyState:NO]; |
+ [[self bubbleWindow] setAllowShareParentKeyState:NO]; |
} |
- (void)windowDidBecomeKey:(NSNotification*)notification { |
// Re-enable share parent key state to make sure the close/minimize/maximize |
// buttons of the parent window are active. |
- InfoBubbleWindow* bubbleWindow = |
- base::mac::ObjCCastStrict<InfoBubbleWindow>([self window]); |
- [bubbleWindow setAllowShareParentKeyState:YES]; |
+ [[self bubbleWindow] setAllowShareParentKeyState:YES]; |
} |
// Since the bubble shares first responder with its parent window, set event |