| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/logging.h" | 14 #include "base/logging.h" |
| 15 #import "chrome/browser/ui/cocoa/animatable_image.h" | 15 #import "chrome/browser/ui/cocoa/animatable_image.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
| 18 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 18 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
| 19 #include "third_party/skia/include/utils/mac/SkCGUtils.h" | 19 #include "third_party/skia/include/utils/mac/SkCGUtils.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 21 #include "ui/gfx/geometry/rect.h" |
| 21 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
| 22 #include "ui/gfx/rect.h" | |
| 23 | 23 |
| 24 class DownloadAnimationWebObserver; | 24 class DownloadAnimationWebObserver; |
| 25 | 25 |
| 26 // A class for managing the Core Animation download animation. | 26 // A class for managing the Core Animation download animation. |
| 27 // Should be instantiated using +startAnimationWithWebContents:. | 27 // Should be instantiated using +startAnimationWithWebContents:. |
| 28 @interface DownloadStartedAnimationMac : NSObject { | 28 @interface DownloadStartedAnimationMac : NSObject { |
| 29 @private | 29 @private |
| 30 CGFloat imageWidth_; | 30 CGFloat imageWidth_; |
| 31 AnimatableImage* animation_; | 31 AnimatableImage* animation_; |
| 32 }; | 32 }; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 @end | 143 @end |
| 144 | 144 |
| 145 void DownloadStartedAnimation::Show(content::WebContents* web_contents) { | 145 void DownloadStartedAnimation::Show(content::WebContents* web_contents) { |
| 146 DCHECK(web_contents); | 146 DCHECK(web_contents); |
| 147 | 147 |
| 148 // Will be deleted when the animation is complete. | 148 // Will be deleted when the animation is complete. |
| 149 [DownloadStartedAnimationMac startAnimationWithWebContents:web_contents]; | 149 [DownloadStartedAnimationMac startAnimationWithWebContents:web_contents]; |
| 150 } | 150 } |
| OLD | NEW |