Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index 0c8c5e65f25b9893efbb74b76db810e5d525d2c3..2f458904689cc9a870f61a0a81eee7eb94a011c7 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -3391,27 +3391,30 @@ void Browser::OnStartDownload(TabContents* source, DownloadItem* download) { |
| // Open the Active Downloads ui for chromeos. |
| ActiveDownloadsUI::OpenPopup(profile_); |
| #else |
| - // GetDownloadShelf creates the download shelf if it was not yet created. |
| - DownloadShelf* shelf = window()->GetDownloadShelf(); |
| - shelf->AddDownload(new DownloadItemModel(download)); |
| - |
| - // Don't show the animation for "Save file" downloads. |
| - if (download->total_bytes() <= 0) |
| - return; |
| - |
| - // For non-theme extensions, we don't show the download animation. |
| - if (download->is_extension_install() && |
| - !ExtensionService::IsDownloadFromMiniGallery(download->GetURL())) |
| - return; |
| - |
| - // Show animation in same window as the download shelf. Download shelf |
| - // may not be in the same window that initiated the download, e.g. Panels. |
| - TabContents* shelf_tab = shelf->browser()->GetSelectedTabContents(); |
| - |
| - // We make this check for the case of minimized windows, unit tests, etc. |
| - if (platform_util::IsVisible(shelf_tab->GetNativeView()) && |
| - ui::Animation::ShouldRenderRichAnimation()) { |
| - DownloadStartedAnimation::Show(shelf_tab); |
| + if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDisableDownloadShelf)) { |
| + // GetDownloadShelf creates the download shelf if it was not yet created. |
| + DownloadShelf* shelf = window()->GetDownloadShelf(); |
| + shelf->AddDownload(new DownloadItemModel(download)); |
| + |
| + // Don't show the animation for "Save file" downloads. |
| + if (download->total_bytes() > 0) { |
|
cbentzel
2011/08/10 11:54:54
This is different behavior from before - now the t
benjhayden
2011/08/10 17:09:17
Right, that's the bug fix part of this CL. It seem
|
| + // For non-theme extensions, we don't show the download animation. |
| + if (!download->is_extension_install() || |
| + ExtensionService::IsDownloadFromMiniGallery(download->GetURL())) { |
|
cbentzel
2011/08/10 11:54:54
Same concern here.
benjhayden
2011/08/10 17:09:17
Same answer.
|
| + // Show animation in same window as the download shelf. Download shelf |
| + // may not be in the same window that initiated the download, e.g. |
| + // Panels. |
| + TabContents* shelf_tab = shelf->browser()->GetSelectedTabContents(); |
| + |
| + // We make this check for the case of minimized windows, unit tests, |
| + // etc. |
| + if (platform_util::IsVisible(shelf_tab->GetNativeView()) && |
| + ui::Animation::ShouldRenderRichAnimation()) { |
| + DownloadStartedAnimation::Show(shelf_tab); |
| + } |
| + } |
| + } |
| } |
| #endif |