Index: chrome/browser/ui/gtk/download/download_shelf_gtk.cc |
diff --git a/chrome/browser/ui/gtk/download/download_shelf_gtk.cc b/chrome/browser/ui/gtk/download/download_shelf_gtk.cc |
index 8355c95bf7a96e9e93537c2d501e109357f73a3a..abc78c142b99ed7651b7c320ee8ea34a3d0fc4f1 100644 |
--- a/chrome/browser/ui/gtk/download/download_shelf_gtk.cc |
+++ b/chrome/browser/ui/gtk/download/download_shelf_gtk.cc |
@@ -18,6 +18,7 @@ |
#include "chrome/browser/ui/gtk/gtk_util.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "content/browser/download/download_item.h" |
+#include "content/browser/download/download_stats.h" |
#include "content/common/notification_service.h" |
#include "grit/generated_resources.h" |
#include "grit/theme_resources.h" |
@@ -194,6 +195,17 @@ void DownloadShelfGtk::Close() { |
gdk_window_raise(shelf_.get()->window); |
slide_widget_->Close(); |
browser_->UpdateDownloadShelfVisibility(false); |
+ download_stats::RecordShelfSize(download_items_.size()); |
+ int num_pending = 0; |
+ for (size_t i = 0; i < download_items_.size(); ++i) { |
+ DownloadItem* download = download_items_[i]->get_download(); |
+ bool is_transfer_done = download->IsComplete() || |
+ download->IsCancelled() || |
+ download->IsInterrupted(); |
+ if (!is_transfer_done) |
+ ++num_pending; |
+ } |
+ download_stats::RecordShelfPendingSize(num_pending); |
SetCloseOnMouseOut(false); |
} |