Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: ppapi/api/dev/ppb_file_chooser_dev.idl

Issue 10527002: Add a comment explaining a different failure mode of the Pepper file chooser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/c/dev/ppb_file_chooser_dev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 /** 7 /**
8 * This file defines the <code>PPB_FileChooser_Dev</code> interface. 8 * This file defines the <code>PPB_FileChooser_Dev</code> interface.
9 */ 9 */
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 [in] PP_Resource resource); 69 [in] PP_Resource resource);
70 70
71 /** 71 /**
72 * This function displays a previously created file chooser resource as a 72 * This function displays a previously created file chooser resource as a
73 * dialog box, prompting the user to choose a file or files. This function 73 * dialog box, prompting the user to choose a file or files. This function
74 * must be called in response to a user gesture, such as a mouse click or 74 * must be called in response to a user gesture, such as a mouse click or
75 * touch event. The callback is called with PP_OK on successful completion 75 * touch event. The callback is called with PP_OK on successful completion
76 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected 76 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected
77 * no file, or another error code from pp_errors.h on failure. 77 * no file, or another error code from pp_errors.h on failure.
78 * 78 *
79 * <b>Subtle note:</b> This function will only work when the tab containing
80 * the plugin is visible. Show will fail if the tab is in the background.
81 * Since it's not normally possible to get input events while invisible, this
82 * is not an issue. But there is a race condition because events are
83 * processed asynchronously that authors should be aware of. If the user
84 * clicks and switches tabs very quickly, a plugin could believe the tab is
85 * visible while Chrome believes it is invisible and the Show() call will
86 * fail. This will not generally cause user confusion since the user will
87 * have switched tabs and will not want to see a file chooser from a
88 * different tab.
89 *
79 * @param[in] chooser The file chooser resource. 90 * @param[in] chooser The file chooser resource.
80 * @param[in] callback A <code>CompletionCallback</code> to be called after 91 * @param[in] callback A <code>CompletionCallback</code> to be called after
81 * the user has closed the file chooser dialog. 92 * the user has closed the file chooser dialog.
82 * 93 *
83 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was 94 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was
84 * successful, another error code from pp_errors.h on failure. 95 * successful, another error code from pp_errors.h on failure.
85 */ 96 */
86 [deprecate=0.6] 97 [deprecate=0.6]
87 int32_t Show( 98 int32_t Show(
88 [in] PP_Resource chooser, 99 [in] PP_Resource chooser,
(...skipping 16 matching lines...) Expand all
105 [in] PP_Resource chooser); 116 [in] PP_Resource chooser);
106 117
107 /** 118 /**
108 * This function displays a previously created file chooser resource as a 119 * This function displays a previously created file chooser resource as a
109 * dialog box, prompting the user to choose a file or files. This function 120 * dialog box, prompting the user to choose a file or files. This function
110 * must be called in response to a user gesture, such as a mouse click or 121 * must be called in response to a user gesture, such as a mouse click or
111 * touch event. The callback is called with PP_OK on successful completion 122 * touch event. The callback is called with PP_OK on successful completion
112 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected 123 * with a file (or files) selected, PP_ERROR_USERCANCEL if the user selected
113 * no file, or another error code from pp_errors.h on failure. 124 * no file, or another error code from pp_errors.h on failure.
114 * 125 *
126 * <b>Subtle note:</b> This function will only work when the tab containing
127 * the plugin is visible. Show() will fail if the tab is in the background.
128 * Since it's not normally possible to get input events while invisible, this
129 * is not normally an issue. But there is a race condition because events are
130 * processed asynchronously. If the user clicks and switches tabs very
131 * quickly, a plugin could believe the tab is visible while Chrome believes
132 * it is invisible and the Show() call will fail. This will not generally
133 * cause user confusion since the user will have switched tabs and will not
134 * want to see a file chooser from a different tab.
135 *
115 * @param[in] chooser The file chooser resource. 136 * @param[in] chooser The file chooser resource.
116 * 137 *
117 * @param[in] output An output array which will receive PP_Resource(s) 138 * @param[in] output An output array which will receive PP_Resource(s)
118 * identifying the <code>PPB_FileRef</code> objects that the user selected on 139 * identifying the <code>PPB_FileRef</code> objects that the user selected on
119 * success. 140 * success.
120 * 141 *
121 * @param[in] callback A <code>CompletionCallback</code> to be called after 142 * @param[in] callback A <code>CompletionCallback</code> to be called after
122 * the user has closed the file chooser dialog. 143 * the user has closed the file chooser dialog.
123 * 144 *
124 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was 145 * @return PP_OK_COMPLETIONPENDING if request to show the dialog was
125 * successful, another error code from pp_errors.h on failure. 146 * successful, another error code from pp_errors.h on failure.
126 */ 147 */
127 [version=0.6] 148 [version=0.6]
128 int32_t Show([in] PP_Resource chooser, 149 int32_t Show([in] PP_Resource chooser,
129 [in] PP_ArrayOutput output, 150 [in] PP_ArrayOutput output,
130 [in] PP_CompletionCallback callback); 151 [in] PP_CompletionCallback callback);
131 }; 152 };
132 153
OLDNEW
« no previous file with comments | « no previous file | ppapi/c/dev/ppb_file_chooser_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698