Index: chrome/browser/history/download_history_info.cc |
diff --git a/chrome/browser/history/download_history_info.cc b/chrome/browser/history/download_history_info.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4602cb9f30b5ebb30e7c06fea63f8fd8a1bf5984 |
--- /dev/null |
+++ b/chrome/browser/history/download_history_info.cc |
@@ -0,0 +1,68 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/history/download_history_info.h" |
+ |
+#include "chrome/browser/download/download_item.h" |
+ |
+DownloadHistoryInfo::DownloadHistoryInfo() |
+ : download_id(-1), |
+ received_bytes(0), |
+ total_bytes(0), |
+ state(0), |
+ db_handle(0) { |
+} |
+ |
+DownloadHistoryInfo::DownloadHistoryInfo(const std::vector<GURL>& urls, |
+ const GURL& referrer, |
+ int64 total_bytes) |
+ : download_id(-1), |
+ url_chain(urls), |
+ referrer_url(referrer), |
+ start_time(base::Time::Now()), |
+ received_bytes(0), |
+ total_bytes(total_bytes), |
+ state(0), |
+ db_handle(0) { |
+} |
+ |
+DownloadHistoryInfo::DownloadHistoryInfo(const FilePath& path, |
+ const GURL& url, |
+ const base::Time& start, |
+ int64 received, |
+ int64 total, |
+ int32 download_state) |
+ : download_id(1), |
+ path(path), |
+ url_chain(1, url), |
+ start_time(start), |
+ received_bytes(received), |
+ total_bytes(total), |
+ state(download_state), |
+ db_handle(0) { |
+} |
+ |
+DownloadHistoryInfo::DownloadHistoryInfo(const FilePath& path, |
+ const std::vector<GURL>& url, |
+ const GURL& referrer, |
+ const base::Time& start, |
+ int64 received, |
+ int64 total, |
+ int32 download_state, |
+ int64 handle, |
+ int32 id) |
+ : download_id(id), |
+ path(path), |
+ url_chain(url), |
+ referrer_url(referrer), |
+ start_time(start), |
+ received_bytes(received), |
+ total_bytes(total), |
+ state(download_state), |
+ db_handle(handle) { |
+} |
+ |
+const GURL& DownloadHistoryInfo::url() const { |
+ return url_chain.empty() ? GURL::EmptyGURL() : url_chain.back(); |
+} |