OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_shelf_controller.h" | 5 #import "chrome/browser/cocoa/download_shelf_controller.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
11 #import "chrome/browser/cocoa/browser_window_controller.h" | 11 #import "chrome/browser/cocoa/browser_window_controller.h" |
12 #include "chrome/browser/cocoa/browser_window_cocoa.h" | 12 #include "chrome/browser/cocoa/browser_window_cocoa.h" |
13 #include "chrome/browser/cocoa/download_item_controller.h" | 13 #include "chrome/browser/cocoa/download_item_controller.h" |
14 #include "chrome/browser/cocoa/download_shelf_mac.h" | 14 #include "chrome/browser/cocoa/download_shelf_mac.h" |
15 #import "chrome/browser/cocoa/download_shelf_view.h" | 15 #import "chrome/browser/cocoa/download_shelf_view.h" |
16 #include "chrome/browser/download/download_manager.h" | 16 #include "chrome/browser/download/download_manager.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Max number of download views we'll contain. Any time a view is added and | 21 // Max number of download views we'll contain. Any time a view is added and |
22 // we already have this many download views, one is removed. | 22 // we already have this many download views, one is removed. |
23 const size_t kMaxDownloadItemCount = 16; | 23 const size_t kMaxDownloadItemCount = 16; |
24 | 24 |
25 // Horizontal padding between two download items. | 25 // Horizontal padding between two download items. |
26 const int kDownloadItemPadding = 2; | 26 const int kDownloadItemPadding = 0; |
27 | 27 |
28 // Duration for the open-new-leftmost-item animation, in seconds. | 28 // Duration for the open-new-leftmost-item animation, in seconds. |
29 const NSTimeInterval kDownloadItemOpenDuration = 0.8; | 29 const NSTimeInterval kDownloadItemOpenDuration = 0.8; |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 @interface DownloadShelfController(Private) | 33 @interface DownloadShelfController(Private) |
34 - (void)applyContentAreaOffset:(BOOL)apply; | 34 - (void)applyContentAreaOffset:(BOOL)apply; |
35 - (void)showDownloadShelf:(BOOL)enable; | 35 - (void)showDownloadShelf:(BOOL)enable; |
36 - (void)resizeDownloadLinkToFit; | 36 - (void)resizeDownloadLinkToFit; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 if (isTransferDone && | 278 if (isTransferDone && |
279 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { | 279 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { |
280 [self remove:itemController]; | 280 [self remove:itemController]; |
281 } else { | 281 } else { |
282 ++i; | 282 ++i; |
283 } | 283 } |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 @end | 287 @end |
OLD | NEW |