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

Unified Diff: chrome/browser/ui/views/download/download_shelf_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: 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_shelf_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index 9f7d42cb753ce5322acac398283fc74ca674fc84..b0b5ea521b6531a805de8da0649f24ef22acd8f1 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -127,8 +127,7 @@ void DownloadShelfView::AddDownloadView(DownloadItemView* view) {
}
void DownloadShelfView::DoAddDownload(DownloadItem* download) {
- DownloadItemView* view = new DownloadItemView(download, this);
- AddDownloadView(view);
+ AddDownloadView(new DownloadItemView(download, this));
}
void DownloadShelfView::MouseMovedOutOfHost() {
@@ -366,6 +365,15 @@ void DownloadShelfView::ButtonPressed(
Close(USER_ACTION);
}
+void DownloadShelfView::RemoveDownload(DownloadItem* download) {
+ for (size_t i = 0; i < download_views_.size(); ++i) {
+ if (download_views_[i]->download() == download) {
+ RemoveDownloadView(download_views_[i]);
+ return;
+ }
+ }
+}
+
bool DownloadShelfView::IsShowing() const {
return visible() && shelf_animation_->IsShowing();
}

Powered by Google App Engine
This is Rietveld 408576698