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

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

Issue 2730015: Mac/clang: Uncontentious fixes. (Closed)
Patch Set: '' Created 10 years, 6 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 scoped_cftyperef<CGImageRef> image(SkCreateCGImageRef(*imageBitmap)); 90 scoped_cftyperef<CGImageRef> image(SkCreateCGImageRef(*imageBitmap));
91 91
92 // Figure out the positioning in the current tab. Try to position the layer 92 // Figure out the positioning in the current tab. Try to position the layer
93 // against the left edge, and three times the download image's height from the 93 // against the left edge, and three times the download image's height from the
94 // bottom of the tab, assuming there is enough room. If there isn't enough, 94 // bottom of the tab, assuming there is enough room. If there isn't enough,
95 // don't show the animation and let the shelf speak for itself. 95 // don't show the animation and let the shelf speak for itself.
96 gfx::Rect bounds; 96 gfx::Rect bounds;
97 tabContents->GetContainerBounds(&bounds); 97 tabContents->GetContainerBounds(&bounds);
98 imageWidth_ = CGImageGetWidth(image); 98 imageWidth_ = CGImageGetWidth(image);
99 CGFloat imageHeight = CGImageGetHeight(image); 99 CGFloat imageHeight = CGImageGetHeight(image);
100 CGRect imageBounds = CGRectMake(0, 0, imageWidth_, imageHeight);
101 100
102 // Sanity check the size in case there's no room to display the animation. 101 // Sanity check the size in case there's no room to display the animation.
103 if (bounds.height() < imageHeight) { 102 if (bounds.height() < imageHeight) {
104 [self release]; 103 [self release];
105 return nil; 104 return nil;
106 } 105 }
107 106
108 NSView* tabContentsView = tabContents->GetNativeView(); 107 NSView* tabContentsView = tabContents->GetNativeView();
109 NSWindow* parentWindow = [tabContentsView window]; 108 NSWindow* parentWindow = [tabContentsView window];
110 if (!parentWindow) { 109 if (!parentWindow) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 228 }
230 229
231 @end 230 @end
232 231
233 void DownloadStartedAnimation::Show(TabContents* tab_contents) { 232 void DownloadStartedAnimation::Show(TabContents* tab_contents) {
234 DCHECK(tab_contents); 233 DCHECK(tab_contents);
235 234
236 // Will be deleted when the animation is complete. 235 // Will be deleted when the animation is complete.
237 [DownloadStartedAnimationMac startAnimationWithTabContents:tab_contents]; 236 [DownloadStartedAnimationMac startAnimationWithTabContents:tab_contents];
238 } 237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698