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