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

Unified Diff: chrome/browser/cocoa/download_started_animation_mac.mm

Issue 3169030: Change the conditions on which the popup blocked animation is shown to be more reliable. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix compile Created 10 years, 4 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/cocoa/download_started_animation_mac.mm
diff --git a/chrome/browser/cocoa/download_started_animation_mac.mm b/chrome/browser/cocoa/download_started_animation_mac.mm
index dfd7db70206fee945597bb045c9e22be67aa44ed..b89bb464d162b86fa9c2f627f4b335387e3078c2 100644
--- a/chrome/browser/cocoa/download_started_animation_mac.mm
+++ b/chrome/browser/cocoa/download_started_animation_mac.mm
@@ -35,8 +35,9 @@ class DownloadAnimationTabObserver;
};
+ (void)startAnimationWithTabContents:(TabContents*)tabContents;
-// Called by our DownloadAnimationTabObserver if the tab is hidden or closed.
-- (void)animationComplete;
+
+// Called by the Observer if the tab is hidden or closed.
+- (void)closeAnimation;
@end
@@ -62,7 +63,7 @@ class DownloadAnimationTabObserver : public NotificationObserver {
const NotificationSource& source,
const NotificationDetails& details) {
// This ends up deleting us.
- [owner_ animationComplete];
+ [owner_ closeAnimation];
}
private:
@@ -162,18 +163,19 @@ class DownloadAnimationTabObserver : public NotificationObserver {
[animation_ setFrame:frame display:YES];
}
-- (void)windowWillClose:(NSNotification*)notification {
- DCHECK([[notification object] isEqual:animation_]);
- [self animationComplete];
+- (void)closeAnimation {
Scott Hess - ex-Googler 2010/08/31 14:29:48 +1 for the name change, -animationComplete never q
+ [animation_ close];
}
-- (void)animationComplete {
+// When the animation closes, close the parent window.
Scott Hess - ex-Googler 2010/08/31 14:29:48 Either this comment is too subtle for me to unders
+- (void)windowWillClose:(NSNotification*)notification {
+ DCHECK([[notification object] isEqual:animation_]);
[[animation_ parentWindow] removeChildWindow:animation_];
[self release];
}
+ (void)startAnimationWithTabContents:(TabContents*)contents {
- // Will be deleted when the animation is complete in -animationComplete.
+ // Will be deleted when the animation window closes.
DownloadStartedAnimationMac* controller =
[[self alloc] initWithTabContents:contents];
// The initializer can return nil.

Powered by Google App Engine
This is Rietveld 408576698