diff options
author | bbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 17:41:30 +0000 |
---|---|---|
committer | bbudge@google.com <bbudge@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-12 17:41:30 +0000 |
commit | ad42ce583947a61beb7701c6cd036b9e5e814c48 (patch) | |
tree | f0ae830751798e016b85871dbbd9fe925d787913 /ppapi | |
parent | e51ddf25f1d720b18fc862ce683897c12c223525 (diff) | |
download | chromium_src-ad42ce583947a61beb7701c6cd036b9e5e814c48.zip chromium_src-ad42ce583947a61beb7701c6cd036b9e5e814c48.tar.gz chromium_src-ad42ce583947a61beb7701c6cd036b9e5e814c48.tar.bz2 |
Move 'SaveAs' functionality from PPB_FileChooser_Dev to PPB_FileChooser_Trusted.We want to follow the Web platform, not diverge, and <input type=saveas> was neverstandardized. Move 'SaveAs' to the trusted interface for Flash.
Review URL: http://codereview.chromium.org/8224012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/api/dev/ppb_file_chooser_dev.idl | 27 | ||||
-rw-r--r-- | ppapi/api/trusted/ppb_file_chooser_trusted.idl | 36 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_file_chooser_dev.h | 29 | ||||
-rw-r--r-- | ppapi/c/trusted/ppb_file_chooser_trusted.h | 21 | ||||
-rw-r--r-- | ppapi/ppapi_cpp.gypi | 1 |
5 files changed, 57 insertions, 57 deletions
diff --git a/ppapi/api/dev/ppb_file_chooser_dev.idl b/ppapi/api/dev/ppb_file_chooser_dev.idl index 9de33dc..12afed2 100644 --- a/ppapi/api/dev/ppb_file_chooser_dev.idl +++ b/ppapi/api/dev/ppb_file_chooser_dev.idl @@ -25,12 +25,7 @@ enum PP_FileChooserMode_Dev { /** * Mode for choosing multiple existing files. */ - PP_FILECHOOSERMODE_OPENMULTIPLE, - /** - * Mode for choosing a file for saving. If the user selects a file that - * doesn't exist, it will be created. - */ - PP_FILECHOOSERMODE_SAVE + PP_FILECHOOSERMODE_OPENMULTIPLE }; interface PPB_FileChooser_Dev { @@ -64,9 +59,8 @@ interface PPB_FileChooser_Dev { * @param[in] resource A <code>PP_Resource</code> corresponding to a generic * resource. * - * @return A <code>PP_Bool</code> containing containing <code>PP_TRUE</code> - * if the given resource is a file chooser resource, otherwise - * <code>PP_FALSE</code>. + * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given + * resource is a file chooser resource, otherwise <code>PP_FALSE</code>. */ PP_Bool IsFileChooser( [in] PP_Resource resource); @@ -74,11 +68,10 @@ interface PPB_FileChooser_Dev { /** * This function displays a previously created file chooser resource as a * dialog box, prompting the user to choose a file or files. This function - * must be called in response to an input event that is a user gesture, such - * as a mouse click or touch event. The callback is called with PP_OK on - * successful completion with a file (or files) selected, PP_ERROR_USERCANCEL - * if the user selected no file, or another error code from pp_errors.h on - * failure. + * must be called in response to a user gesture, such as a mouse click or + * touch event. The callback is called with PP_OK on successful completion + * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected + * no file, or another error code from pp_errors.h on failure. * * @param[in] chooser The file chooser resource. * @param[in] callback A <code>CompletionCallback</code> to be called after @@ -94,10 +87,8 @@ interface PPB_FileChooser_Dev { /** * 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. Depending on the PP_ChooseFileMode_Dev requested when the - * FileChooser was created, the file refs will either be readable or - * writable. Their file system type will be PP_FileSystemType_External. If - * the user chose no files or cancelled the dialog, then this method will + * 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. diff --git a/ppapi/api/trusted/ppb_file_chooser_trusted.idl b/ppapi/api/trusted/ppb_file_chooser_trusted.idl index 97624c8..8f03292 100644 --- a/ppapi/api/trusted/ppb_file_chooser_trusted.idl +++ b/ppapi/api/trusted/ppb_file_chooser_trusted.idl @@ -12,22 +12,30 @@ label Chrome { M16 = 0.5 }; -interface PPB_FileChooser_Trusted { - /** - * This function displays a previously created file chooser resource as a - * dialog box, prompting the user to choose a file or files. The callback is - * called with PP_OK on successful completion with a file (or files) selected - * or PP_ERROR_USERCANCEL if the user selected no file. - * - * @param[in] chooser The file chooser resource. - * @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. - */ +[macro="PPB_FILECHOOSER_TRUSTED_INTERFACE"] +interface PPB_FileChooserTrusted { + /** + * 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 + * single file for saving. The callback is called with PP_OK on successful + * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the + * user selected no file. + * + * @param[in] chooser The file chooser resource. + * @param[in] save_as A <code>PP_Bool</code> value indicating if this dialog + * is choosing a file for saving. + * @param[in] suggested_file_name If saving, the suggested name for the + * file, otherwise, null or undefined. + * @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 ShowWithoutUserGesture( [in] PP_Resource chooser, + [in] PP_Bool save_as, + [in] PP_Var suggested_file_name, [in] PP_CompletionCallback callback); }; diff --git a/ppapi/c/dev/ppb_file_chooser_dev.h b/ppapi/c/dev/ppb_file_chooser_dev.h index 58a5aa5..04a72f8 100644 --- a/ppapi/c/dev/ppb_file_chooser_dev.h +++ b/ppapi/c/dev/ppb_file_chooser_dev.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From dev/ppb_file_chooser_dev.idl modified Tue Oct 04 13:39:06 2011. */ +/* From dev/ppb_file_chooser_dev.idl modified Tue Oct 11 11:17:39 2011. */ #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ @@ -41,12 +41,7 @@ typedef enum { /** * Mode for choosing multiple existing files. */ - PP_FILECHOOSERMODE_OPENMULTIPLE, - /** - * Mode for choosing a file for saving. If the user selects a file that - * doesn't exist, it will be created. - */ - PP_FILECHOOSERMODE_SAVE + PP_FILECHOOSERMODE_OPENMULTIPLE } PP_FileChooserMode_Dev; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FileChooserMode_Dev, 4); /** @@ -86,19 +81,17 @@ struct PPB_FileChooser_Dev { * @param[in] resource A <code>PP_Resource</code> corresponding to a generic * resource. * - * @return A <code>PP_Bool</code> containing containing <code>PP_TRUE</code> - * if the given resource is a file chooser resource, otherwise - * <code>PP_FALSE</code>. + * @return A <code>PP_Bool</code> that is <code>PP_TRUE</code> if the given + * resource is a file chooser resource, otherwise <code>PP_FALSE</code>. */ PP_Bool (*IsFileChooser)(PP_Resource resource); /** * This function displays a previously created file chooser resource as a * dialog box, prompting the user to choose a file or files. This function - * must be called in response to an input event that is a user gesture, such - * as a mouse click or touch event. The callback is called with PP_OK on - * successful completion with a file (or files) selected, PP_ERROR_USERCANCEL - * if the user selected no file, or another error code from pp_errors.h on - * failure. + * must be called in response to a user gesture, such as a mouse click or + * touch event. The callback is called with PP_OK on successful completion + * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected + * no file, or another error code from pp_errors.h on failure. * * @param[in] chooser The file chooser resource. * @param[in] callback A <code>CompletionCallback</code> to be called after @@ -111,10 +104,8 @@ struct PPB_FileChooser_Dev { /** * 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. Depending on the PP_ChooseFileMode_Dev requested when the - * FileChooser was created, the file refs will either be readable or - * writable. Their file system type will be PP_FileSystemType_External. If - * the user chose no files or cancelled the dialog, then this method will + * 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. diff --git a/ppapi/c/trusted/ppb_file_chooser_trusted.h b/ppapi/c/trusted/ppb_file_chooser_trusted.h index 5992281..fbc56fb 100644 --- a/ppapi/c/trusted/ppb_file_chooser_trusted.h +++ b/ppapi/c/trusted/ppb_file_chooser_trusted.h @@ -3,17 +3,19 @@ * found in the LICENSE file. */ -/* From trusted/ppb_file_chooser_trusted.idl modified Tue Oct 04 10:48:17 2011. */ +/* From trusted/ppb_file_chooser_trusted.idl modified Tue Oct 11 11:43:26 2011. */ #ifndef PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ #define PPAPI_C_TRUSTED_PPB_FILE_CHOOSER_TRUSTED_H_ +#include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" +#include "ppapi/c/pp_var.h" -#define PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5 "PPB_FileChooser_Trusted;0.5" +#define PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5 "PPB_FileChooserTrusted;0.5" #define PPB_FILECHOOSER_TRUSTED_INTERFACE PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5 /** @@ -26,14 +28,19 @@ * @addtogroup Interfaces * @{ */ -struct PPB_FileChooser_Trusted { +struct PPB_FileChooserTrusted { /** * This function displays a previously created file chooser resource as a - * dialog box, prompting the user to choose a file or files. The callback is - * called with PP_OK on successful completion with a file (or files) selected - * or PP_ERROR_USERCANCEL if the user selected no file. + * dialog box, prompting the user to choose a file or files to open, or a + * single file for saving. The callback is called with PP_OK on successful + * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the + * user selected no file. * * @param[in] chooser The file chooser resource. + * @param[in] save_as A <code>PP_Bool</code> value indicating if this dialog + * is choosing a file for saving. + * @param[in] suggested_file_name If saving, the suggested name for the + * file, otherwise, null or undefined. * @param[in] callback A <code>CompletionCallback</code> to be called after * the user has closed the file chooser dialog. * @@ -41,6 +48,8 @@ struct PPB_FileChooser_Trusted { * successful, another error code from pp_errors.h on failure. */ int32_t (*ShowWithoutUserGesture)(PP_Resource chooser, + PP_Bool save_as, + struct PP_Var suggested_file_name, struct PP_CompletionCallback callback); }; /** diff --git a/ppapi/ppapi_cpp.gypi b/ppapi/ppapi_cpp.gypi index 6a7914b0..e5a2cee 100644 --- a/ppapi/ppapi_cpp.gypi +++ b/ppapi/ppapi_cpp.gypi @@ -116,6 +116,7 @@ 'c/trusted/ppb_audio_trusted.h', 'c/trusted/ppb_broker_trusted.h', 'c/trusted/ppb_buffer_trusted.h', + 'c/trusted/ppb_file_chooser_trusted.h', 'c/trusted/ppb_file_io_trusted.h', 'c/trusted/ppb_graphics_3d_trusted.h', 'c/trusted/ppb_image_data_trusted.h', |