OLD | NEW |
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 DCHECK(view); | 113 DCHECK(view); |
114 download_views_.push_back(view); | 114 download_views_.push_back(view); |
115 AddChildView(view); | 115 AddChildView(view); |
116 if (download_views_.size() > kMaxDownloadViews) | 116 if (download_views_.size() > kMaxDownloadViews) |
117 RemoveDownloadView(*download_views_.begin()); | 117 RemoveDownloadView(*download_views_.begin()); |
118 | 118 |
119 new_item_animation_->Reset(); | 119 new_item_animation_->Reset(); |
120 new_item_animation_->Show(); | 120 new_item_animation_->Show(); |
121 } | 121 } |
122 | 122 |
123 void DownloadShelfView::DoAddDownload(DownloadItemModel* download_model) { | 123 void DownloadShelfView::DoAddDownload(DownloadItem* download) { |
124 DownloadItemView* view = new DownloadItemView( | 124 DownloadItemView* view = new DownloadItemView(download, this); |
125 download_model->download(), this, download_model); | |
126 AddDownloadView(view); | 125 AddDownloadView(view); |
127 } | 126 } |
128 | 127 |
129 void DownloadShelfView::MouseMovedOutOfHost() { | 128 void DownloadShelfView::MouseMovedOutOfHost() { |
130 Close(); | 129 Close(); |
131 } | 130 } |
132 | 131 |
133 void DownloadShelfView::OnWillChangeFocus(views::View* focused_before, | 132 void DownloadShelfView::OnWillChangeFocus(views::View* focused_before, |
134 views::View* focused_now) { | 133 views::View* focused_now) { |
135 SchedulePaintForDownloadItem(focused_before); | 134 SchedulePaintForDownloadItem(focused_before); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 const DownloadItemView* download_item_view) { | 473 const DownloadItemView* download_item_view) { |
475 gfx::Rect bounds = download_item_view->bounds(); | 474 gfx::Rect bounds = download_item_view->bounds(); |
476 | 475 |
477 #if defined(TOOLKIT_VIEWS) | 476 #if defined(TOOLKIT_VIEWS) |
478 bounds.set_height(bounds.height() - 1); | 477 bounds.set_height(bounds.height() - 1); |
479 bounds.Offset(0, 3); | 478 bounds.Offset(0, 3); |
480 #endif | 479 #endif |
481 | 480 |
482 return bounds; | 481 return bounds; |
483 } | 482 } |
OLD | NEW |