| 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 "content/public/browser/web_contents_view.h" | 17 #include "content/public/browser/web_contents_view.h" |
| 18 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
| 19 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 19 #import "third_party/google_toolbox_for_mac/AppKit/GTMNSAnimation+Duration.h" |
| 20 #include "third_party/skia/include/utils/mac/SkCGUtils.h" | 20 #include "third_party/skia/include/utils/mac/SkCGUtils.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
| 23 #include "ui/gfx/rect.h" | 23 #include "ui/gfx/rect.h" |
| 24 | 24 |
| 25 class DownloadAnimationWebObserver; | 25 class DownloadAnimationWebObserver; |
| 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 +startAnimationWithWebContents:. | 28 // Should be instantiated using +startAnimationWithWebContents:. |
| 29 @interface DownloadStartedAnimationMac : NSObject { | 29 @interface DownloadStartedAnimationMac : NSObject { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 @end | 145 @end |
| 146 | 146 |
| 147 void DownloadStartedAnimation::Show(content::WebContents* web_contents) { | 147 void DownloadStartedAnimation::Show(content::WebContents* web_contents) { |
| 148 DCHECK(web_contents); | 148 DCHECK(web_contents); |
| 149 | 149 |
| 150 // Will be deleted when the animation is complete. | 150 // Will be deleted when the animation is complete. |
| 151 [DownloadStartedAnimationMac startAnimationWithWebContents:web_contents]; | 151 [DownloadStartedAnimationMac startAnimationWithWebContents:web_contents]; |
| 152 } | 152 } |
| OLD | NEW |