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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "chrome/browser/download/download_item_model.h" | 9 #include "chrome/browser/download/download_item_model.h" |
10 #include "chrome/browser/download/download_shelf.h" | 10 #include "chrome/browser/download/download_shelf.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 - (BOOL)isDefaultTheme; | 131 - (BOOL)isDefaultTheme; |
132 @end | 132 @end |
133 | 133 |
134 @implementation DownloadItemCell | 134 @implementation DownloadItemCell |
135 | 135 |
136 @synthesize secondaryTitle = secondaryTitle_; | 136 @synthesize secondaryTitle = secondaryTitle_; |
137 @synthesize secondaryFont = secondaryFont_; | 137 @synthesize secondaryFont = secondaryFont_; |
138 | 138 |
139 - (void)setInitialState { | 139 - (void)setInitialState { |
140 isStatusTextVisible_ = NO; | 140 isStatusTextVisible_ = NO; |
141 titleY_ = kPrimaryTextPosTop; | 141 titleY_ = kPrimaryTextOnlyPosTop; |
142 statusAlpha_ = 0.0; | 142 statusAlpha_ = 0.0; |
143 indeterminateProgressAngle_ = DownloadShelf::kStartAngleDegrees; | 143 indeterminateProgressAngle_ = DownloadShelf::kStartAngleDegrees; |
144 | 144 |
145 [self setFont:[NSFont systemFontOfSize: | 145 [self setFont:[NSFont systemFontOfSize: |
146 [NSFont systemFontSizeForControlSize:NSSmallControlSize]]]; | 146 [NSFont systemFontSizeForControlSize:NSSmallControlSize]]]; |
147 [self setSecondaryFont:[NSFont systemFontOfSize: | 147 [self setSecondaryFont:[NSFont systemFontOfSize: |
148 [NSFont systemFontSizeForControlSize:NSSmallControlSize]]]; | 148 [NSFont systemFontSizeForControlSize:NSSmallControlSize]]]; |
149 | 149 |
150 [self updateTrackingAreas:self]; | 150 [self updateTrackingAreas:self]; |
151 [[NSNotificationCenter defaultCenter] | 151 [[NSNotificationCenter defaultCenter] |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 } | 720 } |
721 | 721 |
722 - (BOOL)isStatusTextVisible { | 722 - (BOOL)isStatusTextVisible { |
723 return isStatusTextVisible_; | 723 return isStatusTextVisible_; |
724 } | 724 } |
725 | 725 |
726 - (CGFloat)statusTextAlpha { | 726 - (CGFloat)statusTextAlpha { |
727 return statusAlpha_; | 727 return statusAlpha_; |
728 } | 728 } |
729 | 729 |
| 730 - (CGFloat)titleY { |
| 731 return titleY_; |
| 732 } |
| 733 |
730 - (void)skipVisibilityAnimation { | 734 - (void)skipVisibilityAnimation { |
731 [toggleStatusVisibilityAnimation_ setCurrentProgress:1.0]; | 735 [toggleStatusVisibilityAnimation_ setCurrentProgress:1.0]; |
732 } | 736 } |
733 | 737 |
734 @end | 738 @end |
735 | 739 |
736 @implementation DownloadItemCellAnimation | 740 @implementation DownloadItemCellAnimation |
737 | 741 |
738 - (id)initWithDownloadItemCell:(DownloadItemCell*)cell | 742 - (id)initWithDownloadItemCell:(DownloadItemCell*)cell |
739 duration:(NSTimeInterval)duration | 743 duration:(NSTimeInterval)duration |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 | 775 |
772 - (void)invalidate { | 776 - (void)invalidate { |
773 [timer_ invalidate]; | 777 [timer_ invalidate]; |
774 } | 778 } |
775 | 779 |
776 - (void)onTimer:(NSTimer*)timer { | 780 - (void)onTimer:(NSTimer*)timer { |
777 [cell_ updateIndeterminateDownload]; | 781 [cell_ updateIndeterminateDownload]; |
778 } | 782 } |
779 | 783 |
780 @end | 784 @end |
OLD | NEW |