OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ |
6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ | 6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ |
7 | 7 |
| 8 #include <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
12 #include "content/public/browser/download_danger_type.h" | 13 #include "content/public/browser/download_danger_type.h" |
13 #include "content/public/browser/download_interrupt_reasons.h" | 14 #include "content/public/browser/download_interrupt_reasons.h" |
14 #include "content/public/browser/download_item.h" | 15 #include "content/public/browser/download_item.h" |
15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
16 | 17 |
17 namespace history { | 18 namespace history { |
18 | 19 |
19 // Contains the information that is stored in the download system's persistent | 20 // Contains the information that is stored in the download system's persistent |
20 // store (or refers to it). DownloadHistory uses this to communicate with the | 21 // store (or refers to it). DownloadHistory uses this to communicate with the |
21 // DownloadDatabase through the HistoryService. | 22 // DownloadDatabase through the HistoryService. |
22 struct DownloadRow { | 23 struct DownloadRow { |
23 DownloadRow(); | 24 DownloadRow(); |
24 DownloadRow( | 25 DownloadRow( |
25 const base::FilePath& current_path, | 26 const base::FilePath& current_path, |
26 const base::FilePath& target_path, | 27 const base::FilePath& target_path, |
27 const std::vector<GURL>& url_chain, | 28 const std::vector<GURL>& url_chain, |
28 const GURL& referrer, | 29 const GURL& referrer, |
| 30 const std::string& mime_type, |
| 31 const std::string& original_mime_type, |
29 const base::Time& start, | 32 const base::Time& start, |
30 const base::Time& end, | 33 const base::Time& end, |
31 const std::string& etag, | 34 const std::string& etag, |
32 const std::string& last_modified, | 35 const std::string& last_modified, |
33 int64 received, | 36 int64 received, |
34 int64 total, | 37 int64 total, |
35 content::DownloadItem::DownloadState download_state, | 38 content::DownloadItem::DownloadState download_state, |
36 content::DownloadDangerType danger_type, | 39 content::DownloadDangerType danger_type, |
37 content::DownloadInterruptReason interrupt_reason, | 40 content::DownloadInterruptReason interrupt_reason, |
38 uint32 id, | 41 uint32 id, |
(...skipping 11 matching lines...) Loading... |
50 | 53 |
51 // The URL redirect chain through which we are downloading. The front | 54 // The URL redirect chain through which we are downloading. The front |
52 // is the url that the initial request went to, and the back is the | 55 // is the url that the initial request went to, and the back is the |
53 // url from which we ended up getting data. This is not changed by | 56 // url from which we ended up getting data. This is not changed by |
54 // UpdateDownload(). | 57 // UpdateDownload(). |
55 std::vector<GURL> url_chain; | 58 std::vector<GURL> url_chain; |
56 | 59 |
57 // The URL that referred us. Is not changed by UpdateDownload(). | 60 // The URL that referred us. Is not changed by UpdateDownload(). |
58 GURL referrer_url; | 61 GURL referrer_url; |
59 | 62 |
| 63 // The mime type of the download, might be based on heuristics. |
| 64 std::string mime_type; |
| 65 |
| 66 // The originial mime type of the download. |
| 67 std::string original_mime_type; |
| 68 |
60 // The time when the download started. Is not changed by UpdateDownload(). | 69 // The time when the download started. Is not changed by UpdateDownload(). |
61 base::Time start_time; | 70 base::Time start_time; |
62 | 71 |
63 // The time when the download completed. | 72 // The time when the download completed. |
64 base::Time end_time; | 73 base::Time end_time; |
65 | 74 |
66 // Contents of most recently seen ETag header. | 75 // Contents of most recently seen ETag header. |
67 std::string etag; | 76 std::string etag; |
68 | 77 |
69 // Contents of most recently seen Last-Modified header. | 78 // Contents of most recently seen Last-Modified header. |
(...skipping 23 matching lines...) Loading... |
93 bool opened; | 102 bool opened; |
94 | 103 |
95 // The id and name of the extension that created this download. | 104 // The id and name of the extension that created this download. |
96 std::string by_ext_id; | 105 std::string by_ext_id; |
97 std::string by_ext_name; | 106 std::string by_ext_name; |
98 }; | 107 }; |
99 | 108 |
100 } // namespace history | 109 } // namespace history |
101 | 110 |
102 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ | 111 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_ |
OLD | NEW |