| 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 // DownloadItem fields | 35 // DownloadItem fields |
| 35 FilePath path; | 36 FilePath path; |
| 36 GURL url; | 37 GURL url; |
| 37 GURL referrer_url; | 38 GURL referrer_url; |
| 38 FilePath suggested_path; | 39 FilePath suggested_path; |
| 39 // A number that should be added to the suggested path to make it unique. | 40 // A number that should be added to the suggested path to make it unique. |
| 40 // 0 means no number should be appended. Not actually stored in the db. | 41 // 0 means no number should be appended. Not actually stored in the db. |
| 41 int path_uniquifier; | 42 int path_uniquifier; |
| 42 base::Time start_time; | 43 base::Time start_time; |
| 43 int64 received_bytes; | 44 int64 received_bytes; |
| 44 int64 total_bytes; | 45 int64 total_bytes; |
| 45 int32 state; | 46 int32 state; |
| 46 int32 download_id; | 47 int32 download_id; |
| 48 bool has_user_gesture; |
| 47 int child_id; | 49 int child_id; |
| 48 int render_view_id; | 50 int render_view_id; |
| 49 int request_id; | 51 int request_id; |
| 50 int64 db_handle; | 52 int64 db_handle; |
| 51 std::string content_disposition; | 53 std::string content_disposition; |
| 52 std::string mime_type; | 54 std::string mime_type; |
| 53 // The value of the content type header sent with the downloaded item. It | 55 // The value of the content type header sent with the downloaded item. It |
| 54 // may be different from |mime_type|, which may be set based on heuristics | 56 // may be different from |mime_type|, which may be set based on heuristics |
| 55 // which may look at the file extension and first few bytes of the file. | 57 // which may look at the file extension and first few bytes of the file. |
| 56 std::string original_mime_type; | 58 std::string original_mime_type; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 67 // Whether this download is for extension install or not. | 69 // Whether this download is for extension install or not. |
| 68 bool is_extension_install; | 70 bool is_extension_install; |
| 69 // The charset of the referring page where the download request comes from. | 71 // The charset of the referring page where the download request comes from. |
| 70 // It's used to construct a suggested filename. | 72 // It's used to construct a suggested filename. |
| 71 std::string referrer_charset; | 73 std::string referrer_charset; |
| 72 // The download file save info. | 74 // The download file save info. |
| 73 DownloadSaveInfo save_info; | 75 DownloadSaveInfo save_info; |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ | 78 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_TYPES_H_ |
| OLD | NEW |