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

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: merge Created 9 years, 2 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
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.h ('k') | content/browser/download/download_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a7ffc8abd5dbb6c96b570915741642cd73567362..148776b48b2e23d502eed9e282b5c8fcaab19560 100644
--- a/chrome/browser/ui/views/download/download_shelf_view.cc
+++ b/chrome/browser/ui/views/download/download_shelf_view.cc
@@ -16,6 +16,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"
@@ -88,6 +89,7 @@ int CenterPosition(int size, int target_size) {
DownloadShelfView::DownloadShelfView(Browser* browser, BrowserView* parent)
: browser_(browser),
parent_(parent),
+ auto_closed_(true),
ALLOW_THIS_IN_INITIALIZER_LIST(
mouse_watcher_(this, this, gfx::Insets())) {
mouse_watcher_.set_notify_on_exit_time_ms(kNotifyOnExitTimeMS);
@@ -371,6 +373,7 @@ void DownloadShelfView::LinkClicked(views::Link* source, int event_flags) {
void DownloadShelfView::ButtonPressed(
views::Button* button, const views::Event& event) {
+ auto_closed_ = false;
Close();
}
@@ -387,8 +390,16 @@ void DownloadShelfView::Show() {
}
void DownloadShelfView::Close() {
+ int num_in_progress = 0;
+ for (size_t i = 0; i < download_views_.size(); ++i) {
+ if (download_views_[i]->download()->IsInProgress())
+ ++num_in_progress;
+ }
+ download_stats::RecordShelfClose(
+ download_views_.size(), num_in_progress, auto_closed_);
parent_->SetDownloadShelfVisible(false);
shelf_animation_->Hide();
+ auto_closed_ = true;
}
Browser* DownloadShelfView::browser() const {
« no previous file with comments | « chrome/browser/ui/views/download/download_shelf_view.h ('k') | content/browser/download/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698