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..0b09ecabd431646dbab7b111c99aa098c41ffc28 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,13 @@ void DownloadShelfGtk::Close() { |
gdk_window_raise(shelf_.get()->window); |
slide_widget_->Close(); |
browser_->UpdateDownloadShelfVisibility(false); |
+ int num_pending = 0; |
+ for (size_t i = 0; i < download_items_.size(); ++i) { |
+ if (download_items_[i]->get_download()->IsInProgress()) |
+ ++num_pending; |
+ } |
+ download_stats::RecordShelfClose( |
+ download_items_.size(), num_pending, close_on_mouse_out_); |
SetCloseOnMouseOut(false); |
} |