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

Side by Side Diff: chrome/browser/cocoa/download_started_animation_mac.mm

Issue 3060047: [Mac] Prevent a crash with the DownloadStartedAnimation. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains the Mac implementation the download animation, displayed 5 // This file contains the Mac implementation the download animation, displayed
6 // at the start of a download. The animation produces an arrow pointing 6 // at the start of a download. The animation produces an arrow pointing
7 // downwards and animates towards the bottom of the window where the new 7 // downwards and animates towards the bottom of the window where the new
8 // download appears in the download shelf. 8 // download appears in the download shelf.
9 9
10 #include "chrome/browser/download/download_started_animation.h" 10 #include "chrome/browser/download/download_started_animation.h"
11 11
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 - (void)animationComplete { 170 - (void)animationComplete {
171 [[animation_ parentWindow] removeChildWindow:animation_]; 171 [[animation_ parentWindow] removeChildWindow:animation_];
172 [self release]; 172 [self release];
173 } 173 }
174 174
175 + (void)startAnimationWithTabContents:(TabContents*)contents { 175 + (void)startAnimationWithTabContents:(TabContents*)contents {
176 // Will be deleted when the animation is complete in -animationComplete. 176 // Will be deleted when the animation is complete in -animationComplete.
177 DownloadStartedAnimationMac* controller = 177 DownloadStartedAnimationMac* controller =
178 [[self alloc] initWithTabContents:contents]; 178 [[self alloc] initWithTabContents:contents];
179 // The initializer can return nil.
180 if (!controller)
181 return;
182
179 // The |animation_| releaes itself when done. 183 // The |animation_| releaes itself when done.
180 [controller->animation_ startAnimation]; 184 [controller->animation_ startAnimation];
181 } 185 }
182 186
183 @end 187 @end
184 188
185 void DownloadStartedAnimation::Show(TabContents* tab_contents) { 189 void DownloadStartedAnimation::Show(TabContents* tab_contents) {
186 DCHECK(tab_contents); 190 DCHECK(tab_contents);
187 191
188 // Will be deleted when the animation is complete. 192 // Will be deleted when the animation is complete.
189 [DownloadStartedAnimationMac startAnimationWithTabContents:tab_contents]; 193 [DownloadStartedAnimationMac startAnimationWithTabContents:tab_contents];
190 } 194 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698