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

Side by Side 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: +tests Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/ui/views/download/download_shelf_view.h" 5 #include "chrome/browser/ui/views/download/download_shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // the order users would expect. 120 // the order users would expect.
121 AddChildViewAt(view, 0); 121 AddChildViewAt(view, 0);
122 if (download_views_.size() > kMaxDownloadViews) 122 if (download_views_.size() > kMaxDownloadViews)
123 RemoveDownloadView(*download_views_.begin()); 123 RemoveDownloadView(*download_views_.begin());
124 124
125 new_item_animation_->Reset(); 125 new_item_animation_->Reset();
126 new_item_animation_->Show(); 126 new_item_animation_->Show();
127 } 127 }
128 128
129 void DownloadShelfView::DoAddDownload(DownloadItem* download) { 129 void DownloadShelfView::DoAddDownload(DownloadItem* download) {
130 DownloadItemView* view = new DownloadItemView(download, this); 130 AddDownloadView(new DownloadItemView(download, this));
131 AddDownloadView(view);
132 } 131 }
133 132
134 void DownloadShelfView::MouseMovedOutOfHost() { 133 void DownloadShelfView::MouseMovedOutOfHost() {
135 Close(AUTOMATIC); 134 Close(AUTOMATIC);
136 } 135 }
137 136
138 void DownloadShelfView::RemoveDownloadView(View* view) { 137 void DownloadShelfView::RemoveDownloadView(View* view) {
139 DCHECK(view); 138 DCHECK(view);
140 std::vector<DownloadItemView*>::iterator i = 139 std::vector<DownloadItemView*>::iterator i =
141 find(download_views_.begin(), download_views_.end(), view); 140 find(download_views_.begin(), download_views_.end(), view);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 SetVisible(false); 419 SetVisible(false);
421 } 420 }
422 421
423 bool DownloadShelfView::CanAutoClose() { 422 bool DownloadShelfView::CanAutoClose() {
424 for (size_t i = 0; i < download_views_.size(); ++i) { 423 for (size_t i = 0; i < download_views_.size(); ++i) {
425 if (!download_views_[i]->download()->GetOpened()) 424 if (!download_views_[i]->download()->GetOpened())
426 return false; 425 return false;
427 } 426 }
428 return true; 427 return true;
429 } 428 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.cc ('k') | chrome/browser/ui/webui/downloads_dom_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698