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

Unified Diff: chrome/browser/browser.cc

Issue 115740: Move download shelf from per-tab to per-window (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 17483)
+++ chrome/browser/browser.cc (working copy)
@@ -18,7 +18,10 @@
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/debugger/debugger_host.h"
#include "chrome/browser/debugger/devtools_manager.h"
+#include "chrome/browser/download/download_item_model.h"
#include "chrome/browser/download/download_manager.h"
+#include "chrome/browser/download/download_shelf.h"
+#include "chrome/browser/download/download_started_animation.h"
#include "chrome/browser/find_bar.h"
#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/location_bar.h"
@@ -42,6 +45,7 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/page_transition_types.h"
+#include "chrome/common/platform_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/url_constants.h"
@@ -1153,6 +1157,25 @@
false, NULL);
}
+void Browser::OnStartDownload(DownloadItem* download) {
+ if (!window())
+ return;
+
+ // GetDownloadShelf creates the download shelf if it was not yet created.
+ window()->GetDownloadShelf()->AddDownload(new DownloadItemModel(download));
+
+// TODO(port): port for mac.
+#if defined(OS_WIN) || defined(OS_LINUX)
+ // Don't show the animation for "Save file" downloads.
+ if (download->total_bytes() > 0) {
+ TabContents* current_tab = GetSelectedTabContents();
+ // We make this check for the case of minimized windows, unit tests, etc.
+ if (platform_util::IsVisible(current_tab->GetNativeView()))
+ DownloadStartedAnimation::Show(current_tab);
+ }
+#endif
+}
+
///////////////////////////////////////////////////////////////////////////////
// static
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698