diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-26 22:21:59 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-26 22:21:59 +0000 |
commit | 11f515acdda3473200ff0cc4106a0020a7d4dc74 (patch) | |
tree | cdfd9713928d6f0fa73b5cd7bedbd965fc93e329 /ppapi/c | |
parent | f60d96e82acd547ac834b93cd68865b66ab5b4da (diff) | |
download | chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.zip chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.tar.gz chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.tar.bz2 |
New file chooser interface that uses the new PP_ArrayOutput feature. This also changes PP_ArrayOutput to be pass-by-value.
This keeps backwards compat for the old interface. It fixes some bugs in the callback system that I found when working on the patch and adds some new machinery for doing array output in the proxy. It also re-enables the file chooser feature which was recently broken.
BUG=118857
Review URL: https://chromiumcodereview.appspot.com/9728001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/ppb_file_chooser_dev.h | 39 | ||||
-rw-r--r-- | ppapi/c/trusted/ppb_file_chooser_trusted.h | 18 |
2 files changed, 36 insertions, 21 deletions
diff --git a/ppapi/c/dev/ppb_file_chooser_dev.h b/ppapi/c/dev/ppb_file_chooser_dev.h index a2ef7ce..81e8f52 100644 --- a/ppapi/c/dev/ppb_file_chooser_dev.h +++ b/ppapi/c/dev/ppb_file_chooser_dev.h @@ -3,11 +3,12 @@ * found in the LICENSE file. */ -/* From dev/ppb_file_chooser_dev.idl modified Mon Nov 14 10:36:01 2011. */ +/* From dev/ppb_file_chooser_dev.idl modified Thu Mar 15 09:29:39 2012. */ #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ +#include "ppapi/c/pp_array_output.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_instance.h" @@ -17,7 +18,8 @@ #include "ppapi/c/pp_var.h" #define PPB_FILECHOOSER_DEV_INTERFACE_0_5 "PPB_FileChooser(Dev);0.5" -#define PPB_FILECHOOSER_DEV_INTERFACE PPB_FILECHOOSER_DEV_INTERFACE_0_5 +#define PPB_FILECHOOSER_DEV_INTERFACE_0_6 "PPB_FileChooser(Dev);0.6" +#define PPB_FILECHOOSER_DEV_INTERFACE PPB_FILECHOOSER_DEV_INTERFACE_0_6 /** * @file @@ -52,7 +54,7 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileChooserMode_Dev, 4); * @addtogroup Interfaces * @{ */ -struct PPB_FileChooser_Dev_0_5 { +struct PPB_FileChooser_Dev_0_6 { /** * This function creates a file chooser dialog resource. The chooser is * associated with a particular instance, so that it may be positioned on the @@ -94,29 +96,32 @@ struct PPB_FileChooser_Dev_0_5 { * no file, or another error code from pp_errors.h on failure. * * @param[in] chooser The file chooser resource. + * + * @param[in] output An output array which will receive PP_Resource(s) + * identifying the <code>PPB_FileRef</code> objects that the user selected on + * success. + * * @param[in] callback A <code>CompletionCallback</code> to be called after * the user has closed the file chooser dialog. * * @return PP_OK_COMPLETIONPENDING if request to show the dialog was * successful, another error code from pp_errors.h on failure. */ + int32_t (*Show)(PP_Resource chooser, + struct PP_ArrayOutput output, + struct PP_CompletionCallback callback); +}; + +typedef struct PPB_FileChooser_Dev_0_6 PPB_FileChooser_Dev; + +struct PPB_FileChooser_Dev_0_5 { + PP_Resource (*Create)(PP_Instance instance, + PP_FileChooserMode_Dev mode, + struct PP_Var accept_mime_types); + PP_Bool (*IsFileChooser)(PP_Resource resource); int32_t (*Show)(PP_Resource chooser, struct PP_CompletionCallback callback); - /** - * After a successful completion callback call from Show, this method may be - * used to query the chosen files. It should be called in a loop until it - * returns 0. Their file system type will be PP_FileSystemType_External. If - * the user chose no files or canceled the dialog, then this method will - * simply return 0 the first time it is called. - * - * @param[in] chooser The file chooser resource. - * - * @return A <code>PP_Resource</code> containing the next file chosen by the - * user, or 0 if there are no more files. - */ PP_Resource (*GetNextChosenFile)(PP_Resource chooser); }; - -typedef struct PPB_FileChooser_Dev_0_5 PPB_FileChooser_Dev; /** * @} */ diff --git a/ppapi/c/trusted/ppb_file_chooser_trusted.h b/ppapi/c/trusted/ppb_file_chooser_trusted.h index 85187a7..048639a 100644 --- a/ppapi/c/trusted/ppb_file_chooser_trusted.h +++ b/ppapi/c/trusted/ppb_file_chooser_trusted.h @@ -4,12 +4,13 @@ */ /* From trusted/ppb_file_chooser_trusted.idl, - * modified Wed Jan 4 11:09:00 2012. + * modified Fri Mar 16 10:00:48 2012. */ #ifndef PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ #define PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ +#include "ppapi/c/pp_array_output.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_macros.h" @@ -18,7 +19,8 @@ #include "ppapi/c/pp_var.h" #define PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5 "PPB_FileChooserTrusted;0.5" -#define PPB_FILECHOOSER_TRUSTED_INTERFACE PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5 +#define PPB_FILECHOOSER_TRUSTED_INTERFACE_0_6 "PPB_FileChooserTrusted;0.6" +#define PPB_FILECHOOSER_TRUSTED_INTERFACE PPB_FILECHOOSER_TRUSTED_INTERFACE_0_6 /** * @file @@ -30,7 +32,7 @@ * @addtogroup Interfaces * @{ */ -struct PPB_FileChooserTrusted_0_5 { +struct PPB_FileChooserTrusted_0_6 { /** * This function displays a previously created file chooser resource as a * dialog box, prompting the user to choose a file or files to open, or a @@ -52,10 +54,18 @@ struct PPB_FileChooserTrusted_0_5 { int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, PP_Bool save_as, struct PP_Var suggested_file_name, + struct PP_ArrayOutput output, struct PP_CompletionCallback callback); }; -typedef struct PPB_FileChooserTrusted_0_5 PPB_FileChooserTrusted; +typedef struct PPB_FileChooserTrusted_0_6 PPB_FileChooserTrusted; + +struct PPB_FileChooserTrusted_0_5 { + int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, + PP_Bool save_as, + struct PP_Var suggested_file_name, + struct PP_CompletionCallback callback); +}; /** * @} */ |