| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "content/browser/download/download_file.h" | 15 #include "content/browser/download/download_file.h" |
| 16 #include "content/browser/download/download_request_handle.h" | 16 #include "content/browser/download/download_request_handle.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/page_transition_types.h" | 18 #include "content/public/common/page_transition_types.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 | 20 |
| 21 // Used for informing the download manager of a new download, since we don't | 21 // Used for informing the download manager of a new download, since we don't |
| 22 // want to pass |DownloadItem|s between threads. | 22 // want to pass |DownloadItem|s between threads. |
| 23 struct CONTENT_EXPORT DownloadCreateInfo { | 23 struct CONTENT_EXPORT DownloadCreateInfo { |
| 24 DownloadCreateInfo(const FilePath& path, | 24 DownloadCreateInfo(const FilePath& path, |
| 25 const GURL& url, | 25 const GURL& url, |
| 26 const base::Time& start_time, | 26 const 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 bool has_user_gesture, |
| 32 PageTransition::Type transition_type); | 32 content::PageTransition transition_type); |
| 33 DownloadCreateInfo(); | 33 DownloadCreateInfo(); |
| 34 ~DownloadCreateInfo(); | 34 ~DownloadCreateInfo(); |
| 35 | 35 |
| 36 std::string DebugString() const; | 36 std::string DebugString() const; |
| 37 | 37 |
| 38 // The URL from which we are downloading. This is the final URL after any | 38 // The URL from which we are downloading. This is the final URL after any |
| 39 // redirection by the server for |url_chain|. | 39 // redirection by the server for |url_chain|. |
| 40 const GURL& url() const; | 40 const GURL& url() const; |
| 41 | 41 |
| 42 // DownloadItem fields | 42 // DownloadItem fields |
| (...skipping 21 matching lines...) Expand all Loading... |
| 64 | 64 |
| 65 // The current state of the download. | 65 // The current state of the download. |
| 66 int32 state; | 66 int32 state; |
| 67 | 67 |
| 68 // The (per-session) ID of the download. | 68 // The (per-session) ID of the download. |
| 69 int32 download_id; | 69 int32 download_id; |
| 70 | 70 |
| 71 // True if the download was initiated by user action. | 71 // True if the download was initiated by user action. |
| 72 bool has_user_gesture; | 72 bool has_user_gesture; |
| 73 | 73 |
| 74 PageTransition::Type transition_type; | 74 content::PageTransition transition_type; |
| 75 | 75 |
| 76 // The handle to the download request information. Used for operations | 76 // The handle to the download request information. Used for operations |
| 77 // outside the download system. | 77 // outside the download system. |
| 78 DownloadRequestHandle request_handle; | 78 DownloadRequestHandle request_handle; |
| 79 | 79 |
| 80 // The handle of the download in the history database. | 80 // The handle of the download in the history database. |
| 81 int64 db_handle; | 81 int64 db_handle; |
| 82 | 82 |
| 83 // The content-disposition string from the response header. | 83 // The content-disposition string from the response header. |
| 84 std::string content_disposition; | 84 std::string content_disposition; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 102 | 102 |
| 103 // The charset of the referring page where the download request comes from. | 103 // The charset of the referring page where the download request comes from. |
| 104 // It's used to construct a suggested filename. | 104 // It's used to construct a suggested filename. |
| 105 std::string referrer_charset; | 105 std::string referrer_charset; |
| 106 | 106 |
| 107 // The download file save info. | 107 // The download file save info. |
| 108 DownloadSaveInfo save_info; | 108 DownloadSaveInfo save_info; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 111 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| OLD | NEW |