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

Unified Diff: chrome/browser/download/download_history.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: uma 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/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 426a4345ff1717053737253bfb607ed3f27efaca..635e90cef426f36527f4aa41e0fad4780c831c31 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -113,6 +113,7 @@ void DownloadHistory::UpdateEntry(DownloadItem* download_item) {
hs->UpdateDownload(download_item->received_bytes(),
download_item->state(),
+ download_item->end_time(),
download_item->db_handle());
}
@@ -162,3 +163,13 @@ void DownloadHistory::OnGotVisitCountToHost(HistoryService::Handle handle,
(first_visit.LocalMidnight() < base::Time::Now().LocalMidnight()));
delete callback;
}
+
+void DownloadHistory::MarkDownloadOpened(int64 db_handle) {
+ // No update necessary if the download was initiated while in incognito mode.
+ if (db_handle <= DownloadItem::kUninitializedHandle)
+ return;
+
+ HistoryService* hs = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ if (hs)
+ hs->MarkDownloadOpened(db_handle);
+}

Powered by Google App Engine
This is Rietveld 408576698