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_DRAG_DOWNLOAD_UTIL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // Parse the download metadata set in DataTransfer.setData. The metadata | 26 // Parse the download metadata set in DataTransfer.setData. The metadata |
27 // consists of a set of the following values separated by ":" | 27 // consists of a set of the following values separated by ":" |
28 // * MIME type | 28 // * MIME type |
29 // * File name | 29 // * File name |
30 // * URL | 30 // * URL |
31 // If the file name contains special characters, they need to be escaped | 31 // If the file name contains special characters, they need to be escaped |
32 // appropriately. | 32 // appropriately. |
33 // For example, we can have | 33 // For example, we can have |
34 // text/plain:example.txt:http://example.com/example.txt | 34 // text/plain:example.txt:http://example.com/example.txt |
35 bool ParseDownloadMetadata(const string16& metadata, | 35 bool ParseDownloadMetadata(const base::string16& metadata, |
36 string16* mime_type, | 36 base::string16* mime_type, |
37 base::FilePath* file_name, | 37 base::FilePath* file_name, |
38 GURL* url); | 38 GURL* url); |
39 | 39 |
40 // Create a new file at the specified path. If the file already exists, try to | 40 // Create a new file at the specified path. If the file already exists, try to |
41 // insert the sequential unifier to produce a new file, like foo-01.txt. | 41 // insert the sequential unifier to produce a new file, like foo-01.txt. |
42 // Return a FileStream if successful. | 42 // Return a FileStream if successful. |
43 // |net_log| is a NetLog for the stream. | 43 // |net_log| is a NetLog for the stream. |
44 CONTENT_EXPORT net::FileStream* CreateFileStreamForDrop( | 44 CONTENT_EXPORT net::FileStream* CreateFileStreamForDrop( |
45 base::FilePath* file_path, net::NetLog* net_log); | 45 base::FilePath* file_path, net::NetLog* net_log); |
46 | 46 |
(...skipping 13 matching lines...) Expand all Loading... |
60 void Cleanup(); | 60 void Cleanup(); |
61 | 61 |
62 scoped_refptr<DragDownloadFile> drag_file_downloader_; | 62 scoped_refptr<DragDownloadFile> drag_file_downloader_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(PromiseFileFinalizer); | 64 DISALLOW_COPY_AND_ASSIGN(PromiseFileFinalizer); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace content | 67 } // namespace content |
68 | 68 |
69 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_ | 69 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_UTIL_H_ |
OLD | NEW |