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/api | |
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/api')
-rw-r--r-- | ppapi/api/dev/ppb_file_chooser_dev.idl | 27 | ||||
-rw-r--r-- | ppapi/api/trusted/ppb_file_chooser_trusted.idl | 36 |
2 files changed, 31 insertions, 32 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); }; |