Chromium Code Reviews| 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 a8310bb11ec8e059ee0bdf6f1b91b0e6846ef761..e443e19457557d419a5cb1ca3a71526c1ceb0c89 100644 |
| --- a/chrome/browser/ui/views/download/download_shelf_view.cc |
| +++ b/chrome/browser/ui/views/download/download_shelf_view.cc |
| @@ -114,7 +114,9 @@ void DownloadShelfView::AddDownloadView(DownloadItemView* view) { |
| DCHECK(view); |
| download_views_.push_back(view); |
| - AddChildView(view); |
| + |
| + // Insert the new view at index 0 to maintain a newest to oldest tab order. |
|
Peter Kasting
2014/05/22 18:23:14
Nit: How about:
Insert the new view as the first
|
| + AddChildViewAt(view, 0); |
| if (download_views_.size() > kMaxDownloadViews) |
| RemoveDownloadView(*download_views_.begin()); |
| @@ -149,7 +151,8 @@ void DownloadShelfView::RemoveDownloadView(View* view) { |
| views::View* DownloadShelfView::GetDefaultFocusableChild() { |
| return download_views_.empty() ? |
| - static_cast<View*>(show_all_view_) : download_views_[0]; |
| + static_cast<View*>(show_all_view_) : |
| + download_views_[download_views_.size() - 1]; |
|
Peter Kasting
2014/05/22 18:23:14
Nit: download_views_.back()
|
| } |
| void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) { |