Index: chrome/browser/ui/cocoa/history_overlay_controller.mm |
diff --git a/chrome/browser/ui/cocoa/history_overlay_controller.mm b/chrome/browser/ui/cocoa/history_overlay_controller.mm |
index 53e879215296ca0c1dcae20dcccdc6ad149b5b7f..16f3ab50d73fc8cd6cc46203b88239c2b4234f46 100644 |
--- a/chrome/browser/ui/cocoa/history_overlay_controller.mm |
+++ b/chrome/browser/ui/cocoa/history_overlay_controller.mm |
@@ -89,13 +89,6 @@ const CGFloat kShieldHeightCompletionAdjust = 10; |
return self; |
} |
-- (void)dealloc { |
- [[BrowserWindowController |
- browserWindowControllerForView:[self view]] onOverlappedViewHidden]; |
- [self.view removeFromSuperview]; |
- [super dealloc]; |
-} |
- |
- (void)loadView { |
const gfx::Image& image = |
ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
@@ -152,6 +145,8 @@ const CGFloat kShieldHeightCompletionAdjust = 10; |
- (void)dismiss { |
const CGFloat kFadeOutDurationSeconds = 0.4; |
+ [NSAnimationContext beginGrouping]; |
+ [NSAnimationContext currentContext].duration = kFadeOutDurationSeconds; |
NSView* overlay = self.view; |
base::scoped_nsobject<CAAnimation> animation( |
@@ -163,9 +158,13 @@ const CGFloat kShieldHeightCompletionAdjust = 10; |
[dictionary setObject:animation forKey:@"alphaValue"]; |
[overlay setAnimations:dictionary]; |
[[overlay animator] setAlphaValue:0.0]; |
+ [NSAnimationContext endGrouping]; |
} |
- (void)animationDidStop:(CAAnimation*)theAnimation finished:(BOOL)finished { |
+ [[BrowserWindowController |
+ browserWindowControllerForView:[self view]] onOverlappedViewHidden]; |
+ [self.view removeFromSuperview]; |
// Destroy the CAAnimation and its strong reference to its delegate (this |
// class). |
[self.view setAnimations:nil]; |