Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2318)

Unified Diff: chrome/browser/ui/browser.cc

Issue 7605003: --downloads-new-ui completely disables the download shelf. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: extract_actions Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698