summaryrefslogtreecommitdiffstats
path: root/ppapi/api
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 22:21:59 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 22:21:59 +0000
commit11f515acdda3473200ff0cc4106a0020a7d4dc74 (patch)
treecdfd9713928d6f0fa73b5cd7bedbd965fc93e329 /ppapi/api
parentf60d96e82acd547ac834b93cd68865b66ab5b4da (diff)
downloadchromium_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/api')
-rw-r--r--ppapi/api/dev/ppb_file_chooser_dev.idl30
-rw-r--r--ppapi/api/pp_array_output.idl1
-rw-r--r--ppapi/api/trusted/ppb_file_chooser_trusted.idl30
3 files changed, 59 insertions, 2 deletions
diff --git a/ppapi/api/dev/ppb_file_chooser_dev.idl b/ppapi/api/dev/ppb_file_chooser_dev.idl
index 980df57..425154b 100644
--- a/ppapi/api/dev/ppb_file_chooser_dev.idl
+++ b/ppapi/api/dev/ppb_file_chooser_dev.idl
@@ -9,7 +9,8 @@
*/
label Chrome {
- M16 = 0.5
+ M16 = 0.5,
+ M19 = 0.6
};
/**
@@ -80,6 +81,7 @@ interface PPB_FileChooser_Dev {
* @return PP_OK_COMPLETIONPENDING if request to show the dialog was
* successful, another error code from pp_errors.h on failure.
*/
+ [deprecate=0.6]
int32_t Show(
[in] PP_Resource chooser,
[in] PP_CompletionCallback callback);
@@ -96,7 +98,33 @@ interface PPB_FileChooser_Dev {
* @return A <code>PP_Resource</code> containing the next file chosen by the
* user, or 0 if there are no more files.
*/
+ [deprecate=0.6]
PP_Resource GetNextChosenFile(
[in] PP_Resource chooser);
+
+ /**
+ * 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 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] 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.
+ */
+ [version=0.6]
+ int32_t Show([in] PP_Resource chooser,
+ [in] PP_ArrayOutput output,
+ [in] PP_CompletionCallback callback);
};
diff --git a/ppapi/api/pp_array_output.idl b/ppapi/api/pp_array_output.idl
index 46411d8..b3b508a 100644
--- a/ppapi/api/pp_array_output.idl
+++ b/ppapi/api/pp_array_output.idl
@@ -75,6 +75,7 @@ typedef mem_t PP_ArrayOutput_GetDataBuffer([inout] mem_t user_data,
* }
* @endcode
*/
+[passByValue]
struct PP_ArrayOutput {
/**
* A pointer to the allocation function that the browser implements.
diff --git a/ppapi/api/trusted/ppb_file_chooser_trusted.idl b/ppapi/api/trusted/ppb_file_chooser_trusted.idl
index d921c81..3d9aea0 100644
--- a/ppapi/api/trusted/ppb_file_chooser_trusted.idl
+++ b/ppapi/api/trusted/ppb_file_chooser_trusted.idl
@@ -9,7 +9,8 @@
*/
label Chrome {
- M16 = 0.5
+ M16 = 0.5,
+ M20 = 0.6
};
[macro="PPB_FILECHOOSER_TRUSTED_INTERFACE"]
@@ -32,10 +33,37 @@ interface PPB_FileChooserTrusted {
* @return PP_OK_COMPLETIONPENDING if request to show the dialog was
* successful, another error code from pp_errors.h on failure.
*/
+ [deprecate=0.6]
int32_t ShowWithoutUserGesture(
[in] PP_Resource chooser,
[in] PP_Bool save_as,
[in] PP_Var suggested_file_name,
[in] PP_CompletionCallback callback);
+
+ /**
+ * 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.
+ */
+ [version=0.6]
+ int32_t ShowWithoutUserGesture(
+ [in] PP_Resource chooser,
+ [in] PP_Bool save_as,
+ [in] PP_Var suggested_file_name,
+ [in] PP_ArrayOutput output,
+ [in] PP_CompletionCallback callback);
};