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 "app/resource_bundle.h" | 8 #include "app/resource_bundle.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 243 matching lines...) Loading... |
254 | 254 |
255 // Start at width 0... | 255 // Start at width 0... |
256 NSSize size = [controller preferredSize]; | 256 NSSize size = [controller preferredSize]; |
257 NSRect frame = NSMakeRect(0, 0, 0, size.height); | 257 NSRect frame = NSMakeRect(0, 0, 0, size.height); |
258 [[controller view] setFrame:frame]; | 258 [[controller view] setFrame:frame]; |
259 | 259 |
260 // ...then animate in | 260 // ...then animate in |
261 frame.size.width = size.width; | 261 frame.size.width = size.width; |
262 [NSAnimationContext beginGrouping]; | 262 [NSAnimationContext beginGrouping]; |
263 [[NSAnimationContext currentContext] | 263 [[NSAnimationContext currentContext] |
264 gtm_setDuration:kDownloadItemOpenDuration]; | 264 gtm_setDuration:kDownloadItemOpenDuration |
| 265 eventMask:NSLeftMouseDownMask]; |
265 [[[controller view] animator] setFrame:frame]; | 266 [[[controller view] animator] setFrame:frame]; |
266 [NSAnimationContext endGrouping]; | 267 [NSAnimationContext endGrouping]; |
267 | 268 |
268 // Keep only a limited number of items in the shelf. | 269 // Keep only a limited number of items in the shelf. |
269 if ([downloadItemControllers_ count] > kMaxDownloadItemCount) { | 270 if ([downloadItemControllers_ count] > kMaxDownloadItemCount) { |
270 DCHECK(kMaxDownloadItemCount > 0); | 271 DCHECK(kMaxDownloadItemCount > 0); |
271 | 272 |
272 // Since no user will ever see the item being removed (needs a horizontal | 273 // Since no user will ever see the item being removed (needs a horizontal |
273 // screen resolution greater than 3200 at 16 items at 200 pixels each), | 274 // screen resolution greater than 3200 at 16 items at 200 pixels each), |
274 // there's no point in animating the removal. | 275 // there's no point in animating the removal. |
(...skipping 17 matching lines...) Loading... |
292 if (isTransferDone && | 293 if (isTransferDone && |
293 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { | 294 [itemController download]->safety_state() != DownloadItem::DANGEROUS) { |
294 [self remove:itemController]; | 295 [self remove:itemController]; |
295 } else { | 296 } else { |
296 ++i; | 297 ++i; |
297 } | 298 } |
298 } | 299 } |
299 } | 300 } |
300 | 301 |
301 @end | 302 @end |
OLD | NEW |