| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
| 10 #include "ppapi/c/pp_macros.h" | 10 #include "ppapi/c/pp_macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // A comma-separated list of MIME types such as audio/*,text/plain. The | 25 // A comma-separated list of MIME types such as audio/*,text/plain. The |
| 26 // dialog may restrict selectable files to the specified MIME types. Null may | 26 // dialog may restrict selectable files to the specified MIME types. Null may |
| 27 // be given to indicate that all types should be accepted. | 27 // be given to indicate that all types should be accepted. |
| 28 // TODO(darin): What if the mime type is unknown to the system? The plugin | 28 // TODO(darin): What if the mime type is unknown to the system? The plugin |
| 29 // may wish to describe the mime type and provide a matching file extension. | 29 // may wish to describe the mime type and provide a matching file extension. |
| 30 // It is more webby to use mime types here instead of file extensions. | 30 // It is more webby to use mime types here instead of file extensions. |
| 31 const char* accept_mime_types; | 31 const char* accept_mime_types; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 #define PPB_FILECHOOSER_DEV_INTERFACE "PPB_FileChooser(Dev);0.3" | 34 #define PPB_FILECHOOSER_DEV_INTERFACE_0_3 "PPB_FileChooser(Dev);0.3" |
| 35 #define PPB_FILECHOOSER_DEV_INTERFACE PPB_FILECHOOSER_DEV_INTERFACE_0_3 |
| 35 | 36 |
| 36 struct PPB_FileChooser_Dev { | 37 struct PPB_FileChooser_Dev { |
| 37 // Creates a file chooser dialog with the specified options. The chooser is | 38 // Creates a file chooser dialog with the specified options. The chooser is |
| 38 // associated with a particular instance, so that it may be positioned on the | 39 // associated with a particular instance, so that it may be positioned on the |
| 39 // screen relative to the tab containing the instance. Returns 0 if passed | 40 // screen relative to the tab containing the instance. Returns 0 if passed |
| 40 // an invalid instance. | 41 // an invalid instance. |
| 41 // | 42 // |
| 42 // A PPB_FileChooser_Dev instance can be used to select a single file | 43 // A PPB_FileChooser_Dev instance can be used to select a single file |
| 43 // (PP_FILECHOOSERMODE_OPEN) or multiple files | 44 // (PP_FILECHOOSERMODE_OPEN) or multiple files |
| 44 // (PP_FILECHOOSERMODE_OPENMULTIPLE). Unlike the HTML5 <input type="file"> | 45 // (PP_FILECHOOSERMODE_OPENMULTIPLE). Unlike the HTML5 <input type="file"> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 // chosen files. It should be called in a loop until it returns 0. | 62 // chosen files. It should be called in a loop until it returns 0. |
| 62 // Depending on the PP_ChooseFileMode requested when the FileChooser was | 63 // Depending on the PP_ChooseFileMode requested when the FileChooser was |
| 63 // created, the file refs will either be readable or writable. Their file | 64 // created, the file refs will either be readable or writable. Their file |
| 64 // system type will be PP_FileSystemType_External. If the user chose no | 65 // system type will be PP_FileSystemType_External. If the user chose no |
| 65 // files or cancelled the dialog, then this method will simply return 0 | 66 // files or cancelled the dialog, then this method will simply return 0 |
| 66 // the first time it is called. | 67 // the first time it is called. |
| 67 PP_Resource (*GetNextChosenFile)(PP_Resource chooser); | 68 PP_Resource (*GetNextChosenFile)(PP_Resource chooser); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 #endif /* PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ */ | 71 #endif /* PPAPI_C_DEV_PPB_FILE_CHOOSER_DEV_H_ */ |
| OLD | NEW |