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

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

Issue 274273002: Views: Reverse Tab order of Download Shelf Items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..aa24d10423398ee6dc9555d8d6b2af2798cbc8a0 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -114,7 +114,11 @@ void DownloadShelfView::AddDownloadView(DownloadItemView* view) {
DCHECK(view);
download_views_.push_back(view);
- AddChildView(view);
+
+ // Insert the new view as the first child, so the logical child order matches
+ // the visual order. This ensures that tabbing through downloads happens in
+ // the order users would expect.
+ AddChildViewAt(view, 0);
if (download_views_.size() > kMaxDownloadViews)
RemoveDownloadView(*download_views_.begin());
@@ -149,7 +153,7 @@ 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_.back();
}
void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698