Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 0c456cddc5fbd8f3ad6164a9c02f89e62fec00ea..0deeb75bc8640109930fc6e4f2dc48c03a3b3c8c 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -3396,27 +3396,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. |
ahendrickson
2011/08/09 19:19:28
Nit: the sense of this comment needs to be flipped
benjhayden
2011/08/09 19:30:51
Can you clarify? I thought I was careful to avoid
|
+ if (download->total_bytes() > 0) { |
+ // For non-theme extensions, we don't show the download animation. |
+ if (!download->is_extension_install() || |
+ ExtensionService::IsDownloadFromMiniGallery(download->GetURL())) { |
+ // 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 |