OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PEPPER_FILE_CHOOSER_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_FILE_CHOOSER_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_FILE_CHOOSER_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_FILE_CHOOSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "third_party/ppapi/c/dev/ppb_file_chooser_dev.h" |
12 #include "third_party/ppapi/c/pp_completion_callback.h" | 13 #include "third_party/ppapi/c/pp_completion_callback.h" |
13 #include "third_party/ppapi/c/ppb_file_chooser.h" | |
14 #include "webkit/glue/plugins/pepper_resource.h" | 14 #include "webkit/glue/plugins/pepper_resource.h" |
15 | 15 |
16 namespace pepper { | 16 namespace pepper { |
17 | 17 |
18 class PluginDelegate; | 18 class PluginDelegate; |
19 class PluginInstance; | 19 class PluginInstance; |
20 | 20 |
21 class FileChooser : public Resource { | 21 class FileChooser : public Resource { |
22 public: | 22 public: |
23 FileChooser(PluginInstance* instance, const PP_FileChooserOptions* options); | 23 FileChooser(PluginInstance* instance, |
| 24 const PP_FileChooserOptions_Dev* options); |
24 virtual ~FileChooser(); | 25 virtual ~FileChooser(); |
25 | 26 |
26 // Returns a pointer to the interface implementing PPB_FileChooser that is | 27 // Returns a pointer to the interface implementing PPB_FileChooser that is |
27 // exposed to the plugin. | 28 // exposed to the plugin. |
28 static const PPB_FileChooser* GetInterface(); | 29 static const PPB_FileChooser_Dev* GetInterface(); |
29 | 30 |
30 // Resource overrides. | 31 // Resource overrides. |
31 FileChooser* AsFileChooser() { return this; } | 32 FileChooser* AsFileChooser() { return this; } |
32 | 33 |
33 // Stores the list of selected files. | 34 // Stores the list of selected files. |
34 void StoreChosenFiles(const std::vector<std::string>& files); | 35 void StoreChosenFiles(const std::vector<std::string>& files); |
35 | 36 |
36 // PPB_FileChooser implementation. | 37 // PPB_FileChooser implementation. |
37 int32_t Show(PP_CompletionCallback callback); | 38 int32_t Show(PP_CompletionCallback callback); |
38 scoped_refptr<FileRef> GetNextChosenFile(); | 39 scoped_refptr<FileRef> GetNextChosenFile(); |
39 | 40 |
40 private: | 41 private: |
41 PluginDelegate* delegate_; | 42 PluginDelegate* delegate_; |
42 PP_FileChooserMode mode_; | 43 PP_FileChooserMode_Dev mode_; |
43 std::string accept_mime_types_; | 44 std::string accept_mime_types_; |
44 PP_CompletionCallback completion_callback_; | 45 PP_CompletionCallback completion_callback_; |
45 std::vector<scoped_refptr<FileRef> > chosen_files_; | 46 std::vector< scoped_refptr<FileRef> > chosen_files_; |
46 size_t next_chosen_file_index_; | 47 size_t next_chosen_file_index_; |
47 }; | 48 }; |
48 | 49 |
49 } // namespace pepper | 50 } // namespace pepper |
50 | 51 |
51 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_FILE_CHOOSER_H_ | 52 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_FILE_CHOOSER_H_ |
OLD | NEW |