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

Unified Diff: chrome/browser/download/download_history.cc

Issue 1875033005: [Downloads/History] Add tab-url and tab-referrer-url to DownloadRow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guid-fix
Patch Set: Update expectations for DownloadUIController test. Created 4 years, 8 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 | « no previous file | chrome/browser/download/download_history_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index eb4e2e9744771f6e72d6c3004ba05cac22cb61f5..6454ebe65319db88b206bc9d8ba6845248964003 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -127,28 +127,18 @@ history::DownloadRow GetDownloadRow(
#endif
return history::DownloadRow(
- item->GetFullPath(),
- item->GetTargetFilePath(),
- item->GetUrlChain(),
- item->GetReferrerUrl(),
+ item->GetFullPath(), item->GetTargetFilePath(), item->GetUrlChain(),
+ item->GetReferrerUrl(), item->GetTabUrl(), item->GetTabReferrerUrl(),
std::string(), // HTTP method (not available yet)
- item->GetMimeType(),
- item->GetOriginalMimeType(),
- item->GetStartTime(),
- item->GetEndTime(),
- item->GetETag(),
- item->GetLastModifiedTime(),
- item->GetReceivedBytes(),
- item->GetTotalBytes(),
+ item->GetMimeType(), item->GetOriginalMimeType(), item->GetStartTime(),
+ item->GetEndTime(), item->GetETag(), item->GetLastModifiedTime(),
+ item->GetReceivedBytes(), item->GetTotalBytes(),
history::ToHistoryDownloadState(item->GetState()),
history::ToHistoryDownloadDangerType(item->GetDangerType()),
history::ToHistoryDownloadInterruptReason(item->GetLastReason()),
std::string(), // Hash value (not available yet)
- history::ToHistoryDownloadId(item->GetId()),
- item->GetGuid(),
- item->GetOpened(),
- by_ext_id,
- by_ext_name);
+ history::ToHistoryDownloadId(item->GetId()), item->GetGuid(),
+ item->GetOpened(), by_ext_id, by_ext_name);
}
bool ShouldUpdateHistory(const history::DownloadRow* previous,
@@ -272,20 +262,10 @@ void DownloadHistory::QueryCallback(std::unique_ptr<InfoVector> infos) {
it != infos->end(); ++it) {
loading_id_ = history::ToContentDownloadId(it->id);
content::DownloadItem* item = notifier_.GetManager()->CreateDownloadItem(
- it->guid,
- loading_id_,
- it->current_path,
- it->target_path,
- it->url_chain,
- it->referrer_url,
- it->mime_type,
- it->original_mime_type,
- it->start_time,
- it->end_time,
- it->etag,
- it->last_modified,
- it->received_bytes,
- it->total_bytes,
+ it->guid, loading_id_, it->current_path, it->target_path, it->url_chain,
+ it->referrer_url, it->tab_url, it->tab_referrer_url, it->mime_type,
+ it->original_mime_type, it->start_time, it->end_time, it->etag,
+ it->last_modified, it->received_bytes, it->total_bytes,
std::string(), // TODO(asanka): Need to persist and restore hash of
// partial file for an interrupted download. No need to
// store hash for a completed file.
« no previous file with comments | « no previous file | chrome/browser/download/download_history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698