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

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: 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/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..98cd8fd3c83129d294affc625b416b1ac92a52c2 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,17 @@ void DownloadShelfView::Show() {
}
void DownloadShelfView::Close() {
+ download_stats::RecordShelfSize(download_views_.size());
+ int num_pending = 0;
+ for (size_t i = 0; i < download_views_.size(); ++i) {
+ DownloadItem* download = download_views_[i]->download();
+ bool is_transfer_done = download->IsComplete() ||
brettw 2011/10/01 16:45:45 This code is duplicated a number of times. Should
benjhayden 2011/10/03 20:54:39 Done with IsInProgress().
+ 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