| 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_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 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 "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 typedef std::vector<std::pair<int, FilePath> > FinalNameList; | 17 typedef std::vector<std::pair<int, base::FilePath> > FinalNameList; |
| 18 typedef std::vector<int> SaveIDList; | 18 typedef std::vector<int> SaveIDList; |
| 19 | 19 |
| 20 // This structure is used to handle and deliver some info | 20 // This structure is used to handle and deliver some info |
| 21 // when processing each save item job. | 21 // when processing each save item job. |
| 22 struct SaveFileCreateInfo { | 22 struct SaveFileCreateInfo { |
| 23 enum SaveFileSource { | 23 enum SaveFileSource { |
| 24 // This type indicates the source is not set. | 24 // This type indicates the source is not set. |
| 25 SAVE_FILE_FROM_UNKNOWN = -1, | 25 SAVE_FILE_FROM_UNKNOWN = -1, |
| 26 // This type indicates the save item needs to be retrieved from the network. | 26 // This type indicates the save item needs to be retrieved from the network. |
| 27 SAVE_FILE_FROM_NET = 0, | 27 SAVE_FILE_FROM_NET = 0, |
| 28 // This type indicates the save item needs to be retrieved from serializing | 28 // This type indicates the save item needs to be retrieved from serializing |
| 29 // DOM. | 29 // DOM. |
| 30 SAVE_FILE_FROM_DOM, | 30 SAVE_FILE_FROM_DOM, |
| 31 // This type indicates the save item needs to be retrieved from local file | 31 // This type indicates the save item needs to be retrieved from local file |
| 32 // system. | 32 // system. |
| 33 SAVE_FILE_FROM_FILE | 33 SAVE_FILE_FROM_FILE |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 SaveFileCreateInfo(const FilePath& path, | 36 SaveFileCreateInfo(const base::FilePath& path, |
| 37 const GURL& url, | 37 const GURL& url, |
| 38 SaveFileSource save_source, | 38 SaveFileSource save_source, |
| 39 int32 save_id); | 39 int32 save_id); |
| 40 | 40 |
| 41 SaveFileCreateInfo(); | 41 SaveFileCreateInfo(); |
| 42 | 42 |
| 43 ~SaveFileCreateInfo(); | 43 ~SaveFileCreateInfo(); |
| 44 | 44 |
| 45 // SaveItem fields. | 45 // SaveItem fields. |
| 46 // The local file path of saved file. | 46 // The local file path of saved file. |
| 47 FilePath path; | 47 base::FilePath path; |
| 48 // Original URL of the saved resource. | 48 // Original URL of the saved resource. |
| 49 GURL url; | 49 GURL url; |
| 50 // Final URL of the saved resource since some URL might be redirected. | 50 // Final URL of the saved resource since some URL might be redirected. |
| 51 GURL final_url; | 51 GURL final_url; |
| 52 // The unique identifier for saving job, assigned at creation by | 52 // The unique identifier for saving job, assigned at creation by |
| 53 // the SaveFileManager for its internal record keeping. | 53 // the SaveFileManager for its internal record keeping. |
| 54 int save_id; | 54 int save_id; |
| 55 // IDs for looking up the contents we are associated with. | 55 // IDs for looking up the contents we are associated with. |
| 56 int render_process_id; | 56 int render_process_id; |
| 57 int render_view_id; | 57 int render_view_id; |
| 58 // Handle for informing the ResourceDispatcherHost of a UI based cancel. | 58 // Handle for informing the ResourceDispatcherHost of a UI based cancel. |
| 59 int request_id; | 59 int request_id; |
| 60 // Disposition info from HTTP response. | 60 // Disposition info from HTTP response. |
| 61 std::string content_disposition; | 61 std::string content_disposition; |
| 62 // Total bytes of saved file. | 62 // Total bytes of saved file. |
| 63 int64 total_bytes; | 63 int64 total_bytes; |
| 64 // Source type of saved file. | 64 // Source type of saved file. |
| 65 SaveFileSource save_source; | 65 SaveFileSource save_source; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace content | 68 } // namespace content |
| 69 | 69 |
| 70 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ | 70 #endif // CONTENT_BROWSER_DOWNLOAD_SAVE_TYPES_H_ |
| OLD | NEW |