 Chromium Code Reviews
 Chromium Code Reviews Issue 209613002:
  Download shelf autohides on showing in shell, just same as regular open 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 209613002:
  Download shelf autohides on showing in shell, just same as regular open 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 2be559bf5be777c72f4bb051e277ee422ab059bb..07f6f3d413814f8e6b6cdac403f80735f15f03e3 100644 | 
| --- a/chrome/browser/ui/views/download/download_shelf_view.cc | 
| +++ b/chrome/browser/ui/views/download/download_shelf_view.cc | 
| @@ -161,6 +161,11 @@ void DownloadShelfView::OpenedDownload(DownloadItemView* view) { | 
| mouse_watcher_.Start(); | 
| } | 
| +void DownloadShelfView::ShownDownload(DownloadItemView* view) { | 
| 
asanka
2014/05/14 18:40:59
Shall we rename this DownloadShown and also rename
 
DukeXar
2014/06/06 15:07:13
Renamed to match observer methods.
Done.
 | 
| + if (CanAutoClose()) | 
| + mouse_watcher_.Start(); | 
| +} | 
| + | 
| content::PageNavigator* DownloadShelfView::GetNavigator() { | 
| return browser_; | 
| } | 
| @@ -409,6 +414,7 @@ void DownloadShelfView::Closed() { | 
| // Treat the item as opened 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); | 
| + download->SetShownWhenComplete(true); | 
| ++i; | 
| } | 
| } | 
| @@ -416,7 +422,8 @@ void DownloadShelfView::Closed() { | 
| bool DownloadShelfView::CanAutoClose() { | 
| for (size_t i = 0; i < download_views_.size(); ++i) { | 
| - if (!download_views_[i]->download()->GetOpened()) | 
| + const content::DownloadItem * download = download_views_[i]->download(); | 
| + if (!download->GetOpened() && !download->GetShownWhenComplete()) | 
| return false; | 
| } | 
| return true; |