| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_DOWNLOAD_SAVE_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_SAVE_INFO_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_SAVE_INFO_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_SAVE_INFO_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "net/base/file_stream.h" | 11 #include "net/base/file_stream.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 // Holds the information about how to save a download file. | 15 // Holds the information about how to save a download file. |
| 16 // In the case of download continuation, |file_path| is set to the current file | 16 // In the case of download continuation, |file_path| is set to the current file |
| 17 // name, |offset| is set to the point where we left off, and |hash_state| will | 17 // name, |offset| is set to the point where we left off, and |hash_state| will |
| 18 // hold the state of the hash algorithm where we left off. | 18 // hold the state of the hash algorithm where we left off. |
| 19 struct CONTENT_EXPORT DownloadSaveInfo { | 19 struct CONTENT_EXPORT DownloadSaveInfo { |
| 20 DownloadSaveInfo(); | 20 DownloadSaveInfo(); |
| 21 ~DownloadSaveInfo(); | 21 ~DownloadSaveInfo(); |
| 22 | 22 |
| 23 // If non-empty, contains the full target path of the download that has been | 23 // If non-empty, contains the full target path of the download that has been |
| 24 // determined prior to download initiation. This is considered to be a trusted | 24 // determined prior to download initiation. This is considered to be a trusted |
| 25 // path. | 25 // path. |
| 26 FilePath file_path; | 26 base::FilePath file_path; |
| 27 | 27 |
| 28 // If non-empty, contains an untrusted filename suggestion. This can't contain | 28 // If non-empty, contains an untrusted filename suggestion. This can't contain |
| 29 // a path (only a filename), and is only effective if |file_path| is empty. | 29 // a path (only a filename), and is only effective if |file_path| is empty. |
| 30 string16 suggested_name; | 30 string16 suggested_name; |
| 31 | 31 |
| 32 // If non-NULL, contains the source data stream for the file contents. | 32 // If non-NULL, contains the source data stream for the file contents. |
| 33 scoped_ptr<net::FileStream> file_stream; | 33 scoped_ptr<net::FileStream> file_stream; |
| 34 | 34 |
| 35 // The file offset at which to start the download. May be 0. | 35 // The file offset at which to start the download. May be 0. |
| 36 int64 offset; | 36 int64 offset; |
| 37 | 37 |
| 38 // The state of the hash at the start of the download. May be empty. | 38 // The state of the hash at the start of the download. May be empty. |
| 39 std::string hash_state; | 39 std::string hash_state; |
| 40 | 40 |
| 41 // If |prompt_for_save_location| is true, and |file_path| is empty, then | 41 // If |prompt_for_save_location| is true, and |file_path| is empty, then |
| 42 // the user will be prompted for a location to save the download. Otherwise, | 42 // the user will be prompted for a location to save the download. Otherwise, |
| 43 // the location will be determined automatically using |file_path| as a | 43 // the location will be determined automatically using |file_path| as a |
| 44 // basis if |file_path| is not empty. | 44 // basis if |file_path| is not empty. |
| 45 // |prompt_for_save_location| defaults to false. | 45 // |prompt_for_save_location| defaults to false. |
| 46 bool prompt_for_save_location; | 46 bool prompt_for_save_location; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(DownloadSaveInfo); | 49 DISALLOW_COPY_AND_ASSIGN(DownloadSaveInfo); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace content | 52 } // namespace content |
| 53 | 53 |
| 54 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_SAVE_INFO_H_ | 54 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_SAVE_INFO_H_ |
| OLD | NEW |