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 #import "chrome/browser/ui/cocoa/download/download_item_cell.h" | 5 #import "chrome/browser/ui/cocoa/download/download_item_cell.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "chrome/browser/download/download_item_model.h" | 8 #include "chrome/browser/download/download_item_model.h" |
9 #include "chrome/browser/download/download_util.h" | 9 #include "chrome/browser/download/download_util.h" |
10 #import "chrome/browser/themes/theme_service.h" | 10 #import "chrome/browser/themes/theme_service.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const CGFloat kDropdownArrowHeight = 3; | 65 const CGFloat kDropdownArrowHeight = 3; |
66 | 66 |
67 // Vertical displacement of dropdown area, relative to the "centered" position. | 67 // Vertical displacement of dropdown area, relative to the "centered" position. |
68 const CGFloat kDropdownAreaY = -2; | 68 const CGFloat kDropdownAreaY = -2; |
69 | 69 |
70 // Duration of the two-lines-to-one-line animation, in seconds. | 70 // Duration of the two-lines-to-one-line animation, in seconds. |
71 NSTimeInterval kShowStatusDuration = 0.3; | 71 NSTimeInterval kShowStatusDuration = 0.3; |
72 NSTimeInterval kHideStatusDuration = 0.3; | 72 NSTimeInterval kHideStatusDuration = 0.3; |
73 | 73 |
74 // Duration of the 'download complete' animation, in seconds. | 74 // Duration of the 'download complete' animation, in seconds. |
75 const int kCompleteAnimationDuration = 2.5; | 75 const CGFloat kCompleteAnimationDuration = 2.5; |
76 | 76 |
77 // Duration of the 'download interrupted' animation, in seconds. | 77 // Duration of the 'download interrupted' animation, in seconds. |
78 const int kInterruptedAnimationDuration = 2.5; | 78 const CGFloat kInterruptedAnimationDuration = 2.5; |
79 | 79 |
80 using content::DownloadItem; | 80 using content::DownloadItem; |
81 | 81 |
82 // This is a helper class to animate the fading out of the status text. | 82 // This is a helper class to animate the fading out of the status text. |
83 @interface DownloadItemCellAnimation : NSAnimation { | 83 @interface DownloadItemCellAnimation : NSAnimation { |
84 DownloadItemCell* cell_; | 84 DownloadItemCell* cell_; |
85 } | 85 } |
86 - (id)initWithDownloadItemCell:(DownloadItemCell*)cell | 86 - (id)initWithDownloadItemCell:(DownloadItemCell*)cell |
87 duration:(NSTimeInterval)duration | 87 duration:(NSTimeInterval)duration |
88 animationCurve:(NSAnimationCurve)animationCurve; | 88 animationCurve:(NSAnimationCurve)animationCurve; |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 } | 686 } |
687 return self; | 687 return self; |
688 } | 688 } |
689 | 689 |
690 - (void)setCurrentProgress:(NSAnimationProgress)progress { | 690 - (void)setCurrentProgress:(NSAnimationProgress)progress { |
691 [super setCurrentProgress:progress]; | 691 [super setCurrentProgress:progress]; |
692 [cell_ animation:self progressed:progress]; | 692 [cell_ animation:self progressed:progress]; |
693 } | 693 } |
694 | 694 |
695 @end | 695 @end |
OLD | NEW |