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

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: Fixed. 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
« no previous file with comments | « Source/web/WebFileChooserCompletionImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 0 is Unix epoch, unit is sec.
57 double modificationTime;
58 long long length;
59 bool isDirectory;
60
61 SelectedFileInfo()
62 : modificationTime(0)
63 , length(0)
64 , isDirectory(false)
65 {
66 }
50 }; 67 };
51 68
52 // Called with zero or more file names. Zero-lengthed vector means that 69 // Called with zero or more file names. Zero-lengthed vector means that
53 // the user cancelled or that file choosing failed. The callback instance 70 // the user cancelled or that file choosing failed. The callback instance
54 // is destroyed when this method is called. 71 // is destroyed when this method is called.
55 virtual void didChooseFile(const WebVector<WebString>& fileNames) = 0; 72 virtual void didChooseFile(const WebVector<WebString>& fileNames) = 0;
56 73
57 // Called with zero or more files, given as a vector of SelectedFileInfo. 74 // Called with zero or more files, given as a vector of SelectedFileInfo.
58 // Zero-lengthed vector means that the user cancelled or that file 75 // Zero-lengthed vector means that the user cancelled or that file
59 // choosing failed. The callback instance is destroyed when this method 76 // choosing failed. The callback instance is destroyed when this method
60 // is called. 77 // is called.
61 // FIXME: Deprecate either one of the didChooseFile (and rename it to 78 // FIXME: Deprecate either one of the didChooseFile (and rename it to
62 // didChooseFile*s*). 79 // didChooseFile*s*).
63 virtual void didChooseFile(const WebVector<SelectedFileInfo>&) { } 80 virtual void didChooseFile(const WebVector<SelectedFileInfo>&) { }
64 protected: 81 protected:
65 virtual ~WebFileChooserCompletion() {} 82 virtual ~WebFileChooserCompletion() {}
66 }; 83 };
67 84
68 } // namespace blink 85 } // namespace blink
69 86
70 #endif 87 #endif
OLDNEW
« no previous file with comments | « Source/web/WebFileChooserCompletionImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698