OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 12 matching lines...) Expand all Loading... |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 * | 27 * |
28 */ | 28 */ |
29 | 29 |
30 #ifndef FileChooser_h | 30 #ifndef FileChooser_h |
31 #define FileChooser_h | 31 #define FileChooser_h |
32 | 32 |
| 33 #include "platform/FileMetadata.h" |
33 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/weborigin/KURL.h" |
34 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
35 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
36 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
37 | 39 |
38 namespace blink { | 40 namespace blink { |
39 | 41 |
40 class FileChooser; | 42 class FileChooser; |
41 | 43 |
42 struct FileChooserFileInfo { | 44 struct FileChooserFileInfo { |
43 FileChooserFileInfo(const String& path, const String& displayName = String()
) | 45 FileChooserFileInfo(const String& path, const String& displayName = String()
) |
44 : path(path) | 46 : path(path) |
45 , displayName(displayName) | 47 , displayName(displayName) |
46 { | 48 { |
47 } | 49 } |
48 | 50 |
| 51 FileChooserFileInfo(const KURL& fileSystemURL, const FileMetadata metadata)
: fileSystemURL(fileSystemURL), metadata(metadata) |
| 52 { |
| 53 } |
| 54 |
| 55 // Members for native files. |
49 const String path; | 56 const String path; |
50 const String displayName; | 57 const String displayName; |
| 58 |
| 59 // Members for file system API files. |
| 60 const KURL fileSystemURL; |
| 61 const FileMetadata metadata; |
51 }; | 62 }; |
52 | 63 |
53 struct FileChooserSettings { | 64 struct FileChooserSettings { |
54 bool allowsMultipleFiles; | 65 bool allowsMultipleFiles; |
55 bool allowsDirectoryUpload; | 66 bool allowsDirectoryUpload; |
56 Vector<String> acceptMIMETypes; | 67 Vector<String> acceptMIMETypes; |
57 Vector<String> acceptFileExtensions; | 68 Vector<String> acceptFileExtensions; |
58 Vector<String> selectedFiles; | 69 Vector<String> selectedFiles; |
59 bool useMediaCapture; | 70 bool useMediaCapture; |
60 | 71 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 private: | 105 private: |
95 FileChooser(FileChooserClient*, const FileChooserSettings&); | 106 FileChooser(FileChooserClient*, const FileChooserSettings&); |
96 | 107 |
97 FileChooserClient* m_client; | 108 FileChooserClient* m_client; |
98 FileChooserSettings m_settings; | 109 FileChooserSettings m_settings; |
99 }; | 110 }; |
100 | 111 |
101 } // namespace blink | 112 } // namespace blink |
102 | 113 |
103 #endif // FileChooser_h | 114 #endif // FileChooser_h |
OLD | NEW |