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

Unified Diff: chrome/browser/ui/views/download/download_shelf_view.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: comments 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/views/download/download_shelf_view.cc
diff --git a/chrome/browser/ui/views/download/download_shelf_view.cc b/chrome/browser/ui/views/download/download_shelf_view.cc
index f60424a4e1b14b7c3968ceeffb6c5f5a96cf0c69..cb4395b020ae5157ef02d08d61b6920d4e9576ca 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/views/download/download_item_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "content/browser/download/download_item.h"
+#include "content/browser/download/download_stats.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "grit/generated_resources.h"
@@ -383,6 +384,18 @@ void DownloadShelfView::Show() {
}
void DownloadShelfView::Close() {
+ download_stats::RecordShelfSize(download_views_.size());
+ int num_pending = 0;
+ size_t i = 0;
+ while (i < download_views_.size()) {
+ DownloadItem* download = download_views_[i]->download();
+ bool is_transfer_done = download->IsComplete() ||
+ download->IsCancelled() ||
+ download->IsInterrupted();
+ if (!is_transfer_done)
+ ++num_pending;
+ }
+ download_stats::RecordShelfPendingSize(num_pending);
parent_->SetDownloadShelfVisible(false);
shelf_animation_->Hide();
}

Powered by Google App Engine
This is Rietveld 408576698