Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3277)

Unified Diff: chrome/browser/ui/cocoa/download/download_shelf_controller.mm

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added browser and unit tests. Renamed 'UserActed' to 'OpenedOrShown'. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cc0cc76fd28091fcce7f9f5dbb5f085c77741c3f..2a43b30765d422e10682ced0d28b192301e8d290 100644
--- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
@@ -8,6 +8,7 @@
#include "base/mac/bundle_locations.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"
@@ -220,7 +221,7 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
}
}
-- (void)downloadWasOpened:(DownloadItemController*)item_controller {
+- (void)downloadWasOpenedOrShown:(DownloadItemController*)item_controller {
// This should only be called on the main thead.
DCHECK([NSThread isMainThread]);
[self maybeAutoCloseAfterDelay];
@@ -384,7 +385,7 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
} else {
// Treat the item as opened 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).SetOpenedOrShown(true);
++i;
}
}
@@ -429,7 +430,7 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
for (NSUInteger i = 0; i < [downloadItemControllers_ count]; ++i) {
DownloadItemController* itemController =
[downloadItemControllers_ objectAtIndex:i];
- if (![itemController download]->GetOpened())
+ if (!DownloadItemModel([itemController download]).GetOpenedOrShown())
return;
}

Powered by Google App Engine
This is Rietveld 408576698