| Index: chrome/browser/ui/cocoa/download/download_shelf_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
|
| index 51c70f7d44dc904954a25c729fa5191ea0bddce2..4b2fa10c80cd71cab0fc69d0bed7bc25a8ecf02b 100644
|
| --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
|
| @@ -7,6 +7,7 @@
|
| #include "base/mac/bundle_locations.h"
|
| #include "base/mac/mac_util.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| +#include "chrome/browser/download/download_item_model.h"
|
| #include "chrome/browser/download/download_stats.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/themes/theme_service.h"
|
| @@ -215,6 +216,12 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
|
| [self maybeAutoCloseAfterDelay];
|
| }
|
|
|
| +- (void)downloadWasShown:(DownloadItemController*)item_controller {
|
| + // This should only be called on the main thead.
|
| + DCHECK([NSThread isMainThread]);
|
| + [self maybeAutoCloseAfterDelay];
|
| +}
|
| +
|
| // We need to explicitly release our download controllers here since they need
|
| // to remove themselves as observers before the remaining shutdown happens.
|
| - (void)exiting {
|
| @@ -380,9 +387,9 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
|
| [self removeDownload:itemController
|
| isShelfClosing:YES];
|
| } else {
|
| - // Treat the item as opened when we close. This way if we get shown again
|
| + // Treat the item as 'acted' when we close. This way if we get shown again
|
| // the user need not open this item for the shelf to auto-close.
|
| - download->SetOpened(true);
|
| + DownloadItemModel(download).SetUserActed(true);
|
| ++i;
|
| }
|
| }
|
| @@ -427,7 +434,8 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
|
| for (NSUInteger i = 0; i < [downloadItemControllers_ count]; ++i) {
|
| DownloadItemController* itemController =
|
| [downloadItemControllers_ objectAtIndex:i];
|
| - if (![itemController download]->GetOpened())
|
| + DownloadItem* download = [itemController download];
|
| + if (!DownloadItemModel(download).GetUserActed())
|
| return;
|
| }
|
|
|
|
|