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