| 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 c9fcae9bbb09732462db62f9bc763f054c699399..843a6934a634884f4da1c72e4e2386b4dcdecee0 100644
|
| --- a/chrome/browser/ui/views/download/download_shelf_view.cc
|
| +++ b/chrome/browser/ui/views/download/download_shelf_view.cc
|
| @@ -195,9 +195,12 @@ void DownloadShelfView::OnPaintBorder(gfx::Canvas* canvas) {
|
| canvas->FillRect(gfx::Rect(0, 0, width(), 1), kBorderColor);
|
| }
|
|
|
| -void DownloadShelfView::OpenedDownload() {
|
| - if (CanAutoClose())
|
| - mouse_watcher_.Start();
|
| +void DownloadShelfView::OnDownloadOpened() {
|
| + TriggerAutoClose();
|
| +}
|
| +
|
| +void DownloadShelfView::OnDownloadShown() {
|
| + TriggerAutoClose();
|
| }
|
|
|
| content::PageNavigator* DownloadShelfView::GetNavigator() {
|
| @@ -404,9 +407,9 @@ void DownloadShelfView::Closed() {
|
| if (is_transfer_done && !download->IsDangerous()) {
|
| RemoveDownloadView(download_views_[i]);
|
| } else {
|
| - // Treat the item as opened when we close. This way if we get shown again
|
| + // Treat the item as acted when we close. This way if we get shown again
|
| // the user need not open this item for the shelf to auto-close.
|
| - download->SetOpened(true);
|
| + DownloadItemModel(download)->SetOpenedOrShown(true);
|
| ++i;
|
| }
|
| }
|
| @@ -415,8 +418,13 @@ void DownloadShelfView::Closed() {
|
|
|
| bool DownloadShelfView::CanAutoClose() {
|
| for (size_t i = 0; i < download_views_.size(); ++i) {
|
| - if (!download_views_[i]->download()->GetOpened())
|
| + if (DownloadItemModel(!download_views_[i]->download()).GetOpenedOrShown())
|
| return false;
|
| }
|
| return true;
|
| }
|
| +
|
| +void DownloadShelfView::TriggerAutoClose() {
|
| + if (CanAutoClose())
|
| + mouse_watcher_.Start();
|
| +}
|
|
|