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_TYPES_H_ | 7 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ |
8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ | 8 #define CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 21 matching lines...) Expand all Loading... |
32 path_uniquifier(0), | 32 path_uniquifier(0), |
33 start_time(start_time), | 33 start_time(start_time), |
34 received_bytes(received_bytes), | 34 received_bytes(received_bytes), |
35 total_bytes(total_bytes), | 35 total_bytes(total_bytes), |
36 state(state), | 36 state(state), |
37 download_id(download_id), | 37 download_id(download_id), |
38 child_id(-1), | 38 child_id(-1), |
39 render_view_id(-1), | 39 render_view_id(-1), |
40 request_id(-1), | 40 request_id(-1), |
41 db_handle(0), | 41 db_handle(0), |
42 save_as(false), | 42 prompt_user_for_save_location(false), |
43 is_dangerous(false), | 43 is_dangerous(false), |
44 is_extension_install(false) { | 44 is_extension_install(false) { |
45 } | 45 } |
46 | 46 |
47 DownloadCreateInfo() | 47 DownloadCreateInfo() |
48 : path_uniquifier(0), | 48 : path_uniquifier(0), |
49 received_bytes(0), | 49 received_bytes(0), |
50 total_bytes(0), | 50 total_bytes(0), |
51 state(-1), | 51 state(-1), |
52 download_id(-1), | 52 download_id(-1), |
53 child_id(-1), | 53 child_id(-1), |
54 render_view_id(-1), | 54 render_view_id(-1), |
55 request_id(-1), | 55 request_id(-1), |
56 db_handle(0), | 56 db_handle(0), |
57 save_as(false), | 57 prompt_user_for_save_location(false), |
58 is_dangerous(false), | 58 is_dangerous(false), |
59 is_extension_install(false) { | 59 is_extension_install(false) { |
60 } | 60 } |
61 | 61 |
62 // DownloadItem fields | 62 // DownloadItem fields |
63 FilePath path; | 63 FilePath path; |
64 GURL url; | 64 GURL url; |
65 GURL referrer_url; | 65 GURL referrer_url; |
66 FilePath suggested_path; | 66 FilePath suggested_path; |
67 // A number that should be added to the suggested path to make it unique. | 67 // A number that should be added to the suggested path to make it unique. |
68 // 0 means no number should be appended. Not actually stored in the db. | 68 // 0 means no number should be appended. Not actually stored in the db. |
69 int path_uniquifier; | 69 int path_uniquifier; |
70 base::Time start_time; | 70 base::Time start_time; |
71 int64 received_bytes; | 71 int64 received_bytes; |
72 int64 total_bytes; | 72 int64 total_bytes; |
73 int32 state; | 73 int32 state; |
74 int32 download_id; | 74 int32 download_id; |
75 int child_id; | 75 int child_id; |
76 int render_view_id; | 76 int render_view_id; |
77 int request_id; | 77 int request_id; |
78 int64 db_handle; | 78 int64 db_handle; |
79 std::string content_disposition; | 79 std::string content_disposition; |
80 std::string mime_type; | 80 std::string mime_type; |
81 // The value of the content type header sent with the downloaded item. It | 81 // The value of the content type header sent with the downloaded item. It |
82 // may be different from |mime_type|, which may be set based on heuristics | 82 // may be different from |mime_type|, which may be set based on heuristics |
83 // which may look at the file extension and first few bytes of the file. | 83 // which may look at the file extension and first few bytes of the file. |
84 std::string original_mime_type; | 84 std::string original_mime_type; |
85 bool save_as; | 85 |
| 86 // True if we should display the 'save as...' UI and prompt the user |
| 87 // for the download location. |
| 88 // False if the UI should be supressed and the download performed to the |
| 89 // default location. |
| 90 bool prompt_user_for_save_location; |
86 // Whether this download is potentially dangerous (ex: exe, dll, ...). | 91 // Whether this download is potentially dangerous (ex: exe, dll, ...). |
87 bool is_dangerous; | 92 bool is_dangerous; |
88 // The original name for a dangerous download. | 93 // The original name for a dangerous download. |
89 FilePath original_name; | 94 FilePath original_name; |
90 // Whether this download is for extension install or not. | 95 // Whether this download is for extension install or not. |
91 bool is_extension_install; | 96 bool is_extension_install; |
92 // The charset of the referring page where the download request comes from. | 97 // The charset of the referring page where the download request comes from. |
93 // It's used to construct a suggested filename. | 98 // It's used to construct a suggested filename. |
94 std::string referrer_charset; | 99 std::string referrer_charset; |
95 // The download file save info. | 100 // The download file save info. |
96 DownloadSaveInfo save_info; | 101 DownloadSaveInfo save_info; |
97 }; | 102 }; |
98 | 103 |
99 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ | 104 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ |
OLD | NEW |