| OLD | NEW |
| 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
| 6 /* From dev/ppb_file_chooser_dev.idl modified Thu May 17 09:04:27 2012. */ | 6 /* From dev/ppb_file_chooser_dev.idl modified Mon Jun 4 12:44:29 2012. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ |
| 9 #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_array_output.h" | 11 #include "ppapi/c/pp_array_output.h" |
| 12 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
| 14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
| 16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 */ | 90 */ |
| 91 PP_Bool (*IsFileChooser)(PP_Resource resource); | 91 PP_Bool (*IsFileChooser)(PP_Resource resource); |
| 92 /** | 92 /** |
| 93 * This function displays a previously created file chooser resource as a | 93 * This function displays a previously created file chooser resource as a |
| 94 * dialog box, prompting the user to choose a file or files. This function | 94 * dialog box, prompting the user to choose a file or files. This function |
| 95 * must be called in response to a user gesture, such as a mouse click or | 95 * must be called in response to a user gesture, such as a mouse click or |
| 96 * touch event. The callback is called with PP_OK on successful completion | 96 * touch event. The callback is called with PP_OK on successful completion |
| 97 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected | 97 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected |
| 98 * no file, or another error code from pp_errors.h on failure. | 98 * no file, or another error code from pp_errors.h on failure. |
| 99 * | 99 * |
| 100 * <b>Subtle note:</b> This function will only work when the tab containing |
| 101 * the plugin is visible. Show() will fail if the tab is in the background. |
| 102 * Since it's not normally possible to get input events while invisible, this |
| 103 * is not normally an issue. But there is a race condition because events are |
| 104 * processed asynchronously. If the user clicks and switches tabs very |
| 105 * quickly, a plugin could believe the tab is visible while Chrome believes |
| 106 * it is invisible and the Show() call will fail. This will not generally |
| 107 * cause user confusion since the user will have switched tabs and will not |
| 108 * want to see a file chooser from a different tab. |
| 109 * |
| 100 * @param[in] chooser The file chooser resource. | 110 * @param[in] chooser The file chooser resource. |
| 101 * | 111 * |
| 102 * @param[in] output An output array which will receive PP_Resource(s) | 112 * @param[in] output An output array which will receive PP_Resource(s) |
| 103 * identifying the <code>PPB_FileRef</code> objects that the user selected on | 113 * identifying the <code>PPB_FileRef</code> objects that the user selected on |
| 104 * success. | 114 * success. |
| 105 * | 115 * |
| 106 * @param[in] callback A <code>CompletionCallback</code> to be called after | 116 * @param[in] callback A <code>CompletionCallback</code> to be called after |
| 107 * the user has closed the file chooser dialog. | 117 * the user has closed the file chooser dialog. |
| 108 * | 118 * |
| 109 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was | 119 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was |
| (...skipping 13 matching lines...) Expand all Loading... |
| 123 PP_Bool (*IsFileChooser)(PP_Resource resource); | 133 PP_Bool (*IsFileChooser)(PP_Resource resource); |
| 124 int32_t (*Show)(PP_Resource chooser, struct PP_CompletionCallback callback); | 134 int32_t (*Show)(PP_Resource chooser, struct PP_CompletionCallback callback); |
| 125 PP_Resource (*GetNextChosenFile)(PP_Resource chooser); | 135 PP_Resource (*GetNextChosenFile)(PP_Resource chooser); |
| 126 }; | 136 }; |
| 127 /** | 137 /** |
| 128 * @} | 138 * @} |
| 129 */ | 139 */ |
| 130 | 140 |
| 131 #endif /* PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ */ | 141 #endif /* PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ */ |
| 132 | 142 |
| OLD | NEW |