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

Unified Diff: chrome/browser/ui/gtk/download/download_shelf_gtk.cc

Issue 8008021: Add new UMA stats to get a handle on Downloads UI Usage (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixed tests Created 9 years, 3 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698