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

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 966983002: downloads: clicking "remove" on chrome://downloads should also hide shelf item. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +tests Created 5 years, 10 months 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/views/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 457e4d49fbb2460b9727e8242cc5b46e2da3f8c3..7a7f2693022d55d002c4068d2c0c2b6a1caa73fe 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -274,6 +274,11 @@ void DownloadItemView::OnExtractIconComplete(gfx::Image* icon_bitmap) {
void DownloadItemView::OnDownloadUpdated(DownloadItem* download_item) {
DCHECK_EQ(download(), download_item);
+ if (!model_.ShouldShowInShelf()) {
+ shelf_->RemoveDownloadView(this); // This will delete us!
+ return;
+ }
+
if (IsShowingWarningDialog() && !model_.IsDangerous()) {
// We have been approved.
ClearWarningDialog();
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_item_mac.mm ('k') | chrome/browser/ui/views/download/download_shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698