| 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_shelf_controller.h" | 5 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/download/download_util.h" | 10 #include "chrome/browser/download/download_util.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 skipFirst = NO; | 293 skipFirst = NO; |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 - (void)layoutItems { | 297 - (void)layoutItems { |
| 298 [self layoutItems:NO]; | 298 [self layoutItems:NO]; |
| 299 } | 299 } |
| 300 | 300 |
| 301 - (void)addDownloadItem:(DownloadItem*)downloadItem { | 301 - (void)addDownloadItem:(DownloadItem*)downloadItem { |
| 302 DCHECK([NSThread isMainThread]); | 302 DCHECK([NSThread isMainThread]); |
| 303 scoped_nsobject<DownloadItemController> controller( | 303 base::scoped_nsobject<DownloadItemController> controller( |
| 304 [[DownloadItemController alloc] initWithDownload:downloadItem | 304 [[DownloadItemController alloc] initWithDownload:downloadItem |
| 305 shelf:self | 305 shelf:self |
| 306 navigator:navigator_]); | 306 navigator:navigator_]); |
| 307 [self add:controller.get()]; | 307 [self add:controller.get()]; |
| 308 } | 308 } |
| 309 | 309 |
| 310 - (void)add:(DownloadItemController*)controller { | 310 - (void)add:(DownloadItemController*)controller { |
| 311 DCHECK([NSThread isMainThread]); | 311 DCHECK([NSThread isMainThread]); |
| 312 [self cancelAutoClose]; | 312 [self cancelAutoClose]; |
| 313 shouldCloseOnMouseExit_ = NO; | 313 shouldCloseOnMouseExit_ = NO; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 } | 502 } |
| 503 | 503 |
| 504 // Set the tracking off to create a new tracking area for the control. | 504 // Set the tracking off to create a new tracking area for the control. |
| 505 // When changing the bounds/frame on a HoverButton, the tracking isn't updated | 505 // When changing the bounds/frame on a HoverButton, the tracking isn't updated |
| 506 // correctly, it needs to be turned off and back on. | 506 // correctly, it needs to be turned off and back on. |
| 507 [hoverCloseButton_ setTrackingEnabled:NO]; | 507 [hoverCloseButton_ setTrackingEnabled:NO]; |
| 508 [hoverCloseButton_ setFrame:bounds]; | 508 [hoverCloseButton_ setFrame:bounds]; |
| 509 [hoverCloseButton_ setTrackingEnabled:YES]; | 509 [hoverCloseButton_ setTrackingEnabled:YES]; |
| 510 } | 510 } |
| 511 @end | 511 @end |
| OLD | NEW |