Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: public/web/WebFileChooserCompletion.h

Issue 640723006: Pass the selected non-native file information from the browser to FileInputType. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebFileChooserCompletion_h 31 #ifndef WebFileChooserCompletion_h
32 #define WebFileChooserCompletion_h 32 #define WebFileChooserCompletion_h
33 33
34 #include "../platform/WebString.h" 34 #include "../platform/WebString.h"
35 #include "../platform/WebURL.h"
35 36
36 namespace blink { 37 namespace blink {
37 38
38 template <typename T> class WebVector; 39 template <typename T> class WebVector;
39 40
40 // Gets called back when WebViewClient finished choosing a file. 41 // Gets called back when WebViewClient finished choosing a file.
41 class WebFileChooserCompletion { 42 class WebFileChooserCompletion {
42 public: 43 public:
43 struct SelectedFileInfo { 44 struct SelectedFileInfo {
44 // The actual path of the selected file. 45 // The actual path of the selected file.
45 WebString path; 46 WebString path;
46 47
47 // The display name of the file that is to be exposed as File.name in 48 // The display name of the file that is to be exposed as File.name in
48 // the DOM layer. If it is empty the base part of the |path| is used. 49 // the DOM layer. If it is empty the base part of the |path| is used.
49 WebString displayName; 50 WebString displayName;
51
52 // File system URL.
53 WebURL fileSystemURL;
54
55 // Metadata of non-native file.
56 double modificationTime;
tkent 2014/10/17 00:20:22 Please add a comment about expected origin and res
pwnall-personal 2014/10/17 08:52:43 I'm not an OWNER, so feel free to ignore this comm
hirono 2014/10/17 09:30:58 I named it after FileMetadata's member. https://co
hirono 2014/10/17 09:30:58 Done.
57 long long length;
58 bool isDirectory;
59
60 SelectedFileInfo()
61 : modificationTime(0)
62 , length(0)
63 , isDirectory(false)
64 {
65 }
50 }; 66 };
51 67
52 // Called with zero or more file names. Zero-lengthed vector means that 68 // Called with zero or more file names. Zero-lengthed vector means that
53 // the user cancelled or that file choosing failed. The callback instance 69 // the user cancelled or that file choosing failed. The callback instance
54 // is destroyed when this method is called. 70 // is destroyed when this method is called.
55 virtual void didChooseFile(const WebVector<WebString>& fileNames) = 0; 71 virtual void didChooseFile(const WebVector<WebString>& fileNames) = 0;
56 72
57 // Called with zero or more files, given as a vector of SelectedFileInfo. 73 // Called with zero or more files, given as a vector of SelectedFileInfo.
58 // Zero-lengthed vector means that the user cancelled or that file 74 // Zero-lengthed vector means that the user cancelled or that file
59 // choosing failed. The callback instance is destroyed when this method 75 // choosing failed. The callback instance is destroyed when this method
60 // is called. 76 // is called.
61 // FIXME: Deprecate either one of the didChooseFile (and rename it to 77 // FIXME: Deprecate either one of the didChooseFile (and rename it to
62 // didChooseFile*s*). 78 // didChooseFile*s*).
63 virtual void didChooseFile(const WebVector<SelectedFileInfo>&) { } 79 virtual void didChooseFile(const WebVector<SelectedFileInfo>&) { }
64 protected: 80 protected:
65 virtual ~WebFileChooserCompletion() {} 81 virtual ~WebFileChooserCompletion() {}
66 }; 82 };
67 83
68 } // namespace blink 84 } // namespace blink
69 85
70 #endif 86 #endif
OLDNEW
« Source/platform/FileChooser.h ('K') | « Source/web/WebFileChooserCompletionImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698