OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Download creation struct used for querying the history service. | 5 // Download creation struct used for querying the history service. |
6 | 6 |
7 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ | 7 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ |
8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ | 8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "chrome/browser/download/download_file.h" | 16 #include "chrome/browser/download/download_file.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 | 18 |
19 // Used for informing the download database of a new download, where we don't | 19 // Used for informing the download database of a new download, where we don't |
20 // want to pass DownloadItems between threads. The history service also uses a | 20 // want to pass DownloadItems between threads. The history service also uses a |
21 // vector of these structs for passing us the state of all downloads at | 21 // vector of these structs for passing us the state of all downloads at |
22 // initialization time (see DownloadQueryInfo below). | 22 // initialization time (see DownloadQueryInfo below). |
23 struct DownloadCreateInfo { | 23 struct DownloadCreateInfo { |
24 DownloadCreateInfo(const FilePath& path, | 24 DownloadCreateInfo(const FilePath& path, |
25 const GURL& url, | 25 const GURL& url, |
26 base::Time start_time, | 26 base::Time start_time, |
27 int64 received_bytes, | 27 int64 received_bytes, |
28 int64 total_bytes, | 28 int64 total_bytes, |
29 int32 state, | 29 int32 state, |
30 int32 download_id); | 30 int32 download_id, |
| 31 bool has_user_gesture); |
31 DownloadCreateInfo(); | 32 DownloadCreateInfo(); |
32 ~DownloadCreateInfo(); | 33 ~DownloadCreateInfo(); |
33 | 34 |
34 std::string DebugString() const; | 35 std::string DebugString() const; |
35 | 36 |
36 // DownloadItem fields | 37 // DownloadItem fields |
37 FilePath path; | 38 FilePath path; |
38 GURL url; | 39 GURL url; |
39 GURL referrer_url; | 40 GURL referrer_url; |
40 FilePath suggested_path; | 41 FilePath suggested_path; |
41 // A number that should be added to the suggested path to make it unique. | 42 // A number that should be added to the suggested path to make it unique. |
42 // 0 means no number should be appended. Not actually stored in the db. | 43 // 0 means no number should be appended. Not actually stored in the db. |
43 int path_uniquifier; | 44 int path_uniquifier; |
44 base::Time start_time; | 45 base::Time start_time; |
45 int64 received_bytes; | 46 int64 received_bytes; |
46 int64 total_bytes; | 47 int64 total_bytes; |
47 int32 state; | 48 int32 state; |
48 int32 download_id; | 49 int32 download_id; |
| 50 bool has_user_gesture; |
49 int child_id; | 51 int child_id; |
50 int render_view_id; | 52 int render_view_id; |
51 int request_id; | 53 int request_id; |
52 int64 db_handle; | 54 int64 db_handle; |
53 std::string content_disposition; | 55 std::string content_disposition; |
54 std::string mime_type; | 56 std::string mime_type; |
55 // The value of the content type header sent with the downloaded item. It | 57 // The value of the content type header sent with the downloaded item. It |
56 // may be different from |mime_type|, which may be set based on heuristics | 58 // may be different from |mime_type|, which may be set based on heuristics |
57 // which may look at the file extension and first few bytes of the file. | 59 // which may look at the file extension and first few bytes of the file. |
58 std::string original_mime_type; | 60 std::string original_mime_type; |
(...skipping 10 matching lines...) Expand all Loading... |
69 // Whether this download is for extension install or not. | 71 // Whether this download is for extension install or not. |
70 bool is_extension_install; | 72 bool is_extension_install; |
71 // The charset of the referring page where the download request comes from. | 73 // The charset of the referring page where the download request comes from. |
72 // It's used to construct a suggested filename. | 74 // It's used to construct a suggested filename. |
73 std::string referrer_charset; | 75 std::string referrer_charset; |
74 // The download file save info. | 76 // The download file save info. |
75 DownloadSaveInfo save_info; | 77 DownloadSaveInfo save_info; |
76 }; | 78 }; |
77 | 79 |
78 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ | 80 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_CREATE_INFO_H_ |
OLD | NEW |