OLD | NEW |
1 // Copyright (c) 2010 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 |
12 #import <QuartzCore/QuartzCore.h> | 12 #import <QuartzCore/QuartzCore.h> |
13 | 13 |
14 #include "app/resource_bundle.h" | |
15 #include "chrome/browser/tab_contents/tab_contents.h" | 14 #include "chrome/browser/tab_contents/tab_contents.h" |
16 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" | 15 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
17 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
18 #import "chrome/browser/ui/cocoa/animatable_image.h" | 17 #import "chrome/browser/ui/cocoa/animatable_image.h" |
19 #include "chrome/common/notification_details.h" | 18 #include "chrome/common/notification_details.h" |
20 #include "chrome/common/notification_source.h" | 19 #include "chrome/common/notification_source.h" |
21 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
22 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 21 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
23 #include "third_party/skia/include/utils/mac/SkCGUtils.h" | 22 #include "third_party/skia/include/utils/mac/SkCGUtils.h" |
| 23 #include "ui/base/resource/resource_bundle.h" |
24 | 24 |
25 class DownloadAnimationTabObserver; | 25 class DownloadAnimationTabObserver; |
26 | 26 |
27 // A class for managing the Core Animation download animation. | 27 // A class for managing the Core Animation download animation. |
28 // Should be instantiated using +startAnimationWithTabContents:. | 28 // Should be instantiated using +startAnimationWithTabContents:. |
29 @interface DownloadStartedAnimationMac : NSObject { | 29 @interface DownloadStartedAnimationMac : NSObject { |
30 @private | 30 @private |
31 // The observer for the TabContents we are drawing on. | 31 // The observer for the TabContents we are drawing on. |
32 scoped_ptr<DownloadAnimationTabObserver> observer_; | 32 scoped_ptr<DownloadAnimationTabObserver> observer_; |
33 CGFloat imageWidth_; | 33 CGFloat imageWidth_; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 187 } |
188 | 188 |
189 @end | 189 @end |
190 | 190 |
191 void DownloadStartedAnimation::Show(TabContents* tab_contents) { | 191 void DownloadStartedAnimation::Show(TabContents* tab_contents) { |
192 DCHECK(tab_contents); | 192 DCHECK(tab_contents); |
193 | 193 |
194 // Will be deleted when the animation is complete. | 194 // Will be deleted when the animation is complete. |
195 [DownloadStartedAnimationMac startAnimationWithTabContents:tab_contents]; | 195 [DownloadStartedAnimationMac startAnimationWithTabContents:tab_contents]; |
196 } | 196 } |
OLD | NEW |