| 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/page_transition_types.h" |
| 17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 18 | 19 |
| 19 // Used for informing the download manager of a new download, since we don't | 20 // Used for informing the download manager of a new download, since we don't |
| 20 // want to pass |DownloadItem|s between threads. | 21 // want to pass |DownloadItem|s between threads. |
| 21 struct DownloadCreateInfo { | 22 struct DownloadCreateInfo { |
| 22 DownloadCreateInfo(const FilePath& path, | 23 DownloadCreateInfo(const FilePath& path, |
| 23 const GURL& url, | 24 const GURL& url, |
| 24 const base::Time& start_time, | 25 const base::Time& start_time, |
| 25 int64 received_bytes, | 26 int64 received_bytes, |
| 26 int64 total_bytes, | 27 int64 total_bytes, |
| 27 int32 state, | 28 int32 state, |
| 28 int32 download_id, | 29 int32 download_id, |
| 29 bool has_user_gesture); | 30 bool has_user_gesture, |
| 31 PageTransition::Type transition_type); |
| 30 DownloadCreateInfo(); | 32 DownloadCreateInfo(); |
| 31 ~DownloadCreateInfo(); | 33 ~DownloadCreateInfo(); |
| 32 | 34 |
| 33 std::string DebugString() const; | 35 std::string DebugString() const; |
| 34 | 36 |
| 35 // The URL from which we are downloading. This is the final URL after any | 37 // The URL from which we are downloading. This is the final URL after any |
| 36 // redirection by the server for |url_chain|. | 38 // redirection by the server for |url_chain|. |
| 37 const GURL& url() const; | 39 const GURL& url() const; |
| 38 | 40 |
| 39 // DownloadItem fields | 41 // DownloadItem fields |
| (...skipping 21 matching lines...) Expand all Loading... |
| 61 | 63 |
| 62 // The current state of the download. | 64 // The current state of the download. |
| 63 int32 state; | 65 int32 state; |
| 64 | 66 |
| 65 // The (per-session) ID of the download. | 67 // The (per-session) ID of the download. |
| 66 int32 download_id; | 68 int32 download_id; |
| 67 | 69 |
| 68 // True if the download was initiated by user action. | 70 // True if the download was initiated by user action. |
| 69 bool has_user_gesture; | 71 bool has_user_gesture; |
| 70 | 72 |
| 73 PageTransition::Type transition_type; |
| 74 |
| 71 // The handle to the download request information. Used for operations | 75 // The handle to the download request information. Used for operations |
| 72 // outside the download system. | 76 // outside the download system. |
| 73 DownloadRequestHandle request_handle; | 77 DownloadRequestHandle request_handle; |
| 74 | 78 |
| 75 // The handle of the download in the history database. | 79 // The handle of the download in the history database. |
| 76 int64 db_handle; | 80 int64 db_handle; |
| 77 | 81 |
| 78 // The content-disposition string from the response header. | 82 // The content-disposition string from the response header. |
| 79 std::string content_disposition; | 83 std::string content_disposition; |
| 80 | 84 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 100 | 104 |
| 101 // The charset of the referring page where the download request comes from. | 105 // The charset of the referring page where the download request comes from. |
| 102 // It's used to construct a suggested filename. | 106 // It's used to construct a suggested filename. |
| 103 std::string referrer_charset; | 107 std::string referrer_charset; |
| 104 | 108 |
| 105 // The download file save info. | 109 // The download file save info. |
| 106 DownloadSaveInfo save_info; | 110 DownloadSaveInfo save_info; |
| 107 }; | 111 }; |
| 108 | 112 |
| 109 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ | 113 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_CREATE_INFO_H_ |
| OLD | NEW |