| 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 #import "chrome/browser/cocoa/download_item_cell.h" | 5 #import "chrome/browser/cocoa/download_item_cell.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/text_elider.h" | 8 #include "app/text_elider.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 initWithDownloadItemCell:self | 261 initWithDownloadItemCell:self |
| 262 duration:kCompleteAnimationDuration | 262 duration:kCompleteAnimationDuration |
| 263 animationCurve:NSAnimationLinear]); | 263 animationCurve:NSAnimationLinear]); |
| 264 [completionAnimation_.get() setDelegate:self]; | 264 [completionAnimation_.get() setDelegate:self]; |
| 265 [completionAnimation_.get() startAnimation]; | 265 [completionAnimation_.get() startAnimation]; |
| 266 percentDone_ = -1; | 266 percentDone_ = -1; |
| 267 break; | 267 break; |
| 268 case DownloadItem::CANCELLED: | 268 case DownloadItem::CANCELLED: |
| 269 percentDone_ = -1; | 269 percentDone_ = -1; |
| 270 break; | 270 break; |
| 271 case DownloadItem::INTERRUPTED: |
| 272 percentDone_ = -1; |
| 273 break; |
| 271 case DownloadItem::IN_PROGRESS: | 274 case DownloadItem::IN_PROGRESS: |
| 272 percentDone_ = downloadModel->download()->is_paused() ? | 275 percentDone_ = downloadModel->download()->is_paused() ? |
| 273 -1 : downloadModel->download()->PercentComplete(); | 276 -1 : downloadModel->download()->PercentComplete(); |
| 274 break; | 277 break; |
| 275 default: | 278 default: |
| 276 NOTREACHED(); | 279 NOTREACHED(); |
| 277 } | 280 } |
| 278 | 281 |
| 279 [[self controlView] setNeedsDisplay:YES]; | 282 [[self controlView] setNeedsDisplay:YES]; |
| 280 } | 283 } |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 } | 702 } |
| 700 return self; | 703 return self; |
| 701 } | 704 } |
| 702 | 705 |
| 703 - (void)setCurrentProgress:(NSAnimationProgress)progress { | 706 - (void)setCurrentProgress:(NSAnimationProgress)progress { |
| 704 [super setCurrentProgress:progress]; | 707 [super setCurrentProgress:progress]; |
| 705 [cell_ animation:self progressed:progress]; | 708 [cell_ animation:self progressed:progress]; |
| 706 } | 709 } |
| 707 | 710 |
| 708 @end | 711 @end |
| OLD | NEW |