Home | History | Annotate | Download | only in trusted
      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
      3  * found in the LICENSE file.
      4  */
      5 
      6 
      7 /**
      8  * This file defines the <code>PPB_FileChooser_Trusted</code> interface.
      9  */
     10 
     11 [generate_thunk]
     12 
     13 label Chrome {
     14   M16 = 0.5,
     15   M20 = 0.6
     16 };
     17 
     18 [macro="PPB_FILECHOOSER_TRUSTED_INTERFACE"]
     19 interface PPB_FileChooserTrusted {
     20  /**
     21   * This function displays a previously created file chooser resource as a
     22   * dialog box, prompting the user to choose a file or files to open, or a
     23   * single file for saving. The callback is called with PP_OK on successful
     24   * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the
     25   * user selected no file.
     26   *
     27   * @param[in] chooser The file chooser resource.
     28   * @param[in] save_as A <code>PP_Bool</code> value indicating if this dialog
     29   * is choosing a file for saving.
     30   * @param[in] suggested_file_name If saving, the suggested name for the
     31   * file, otherwise, null or undefined.
     32   * @param[in] callback A <code>CompletionCallback</code> to be called after
     33   * the user has closed the file chooser dialog.
     34   *
     35   * @return PP_OK_COMPLETIONPENDING if request to show the dialog was
     36   * successful, another error code from pp_errors.h on failure.
     37   */
     38   [deprecate=0.6]
     39   int32_t ShowWithoutUserGesture(
     40       [in] PP_Resource chooser,
     41       [in] PP_Bool save_as,
     42       [in] PP_Var suggested_file_name,
     43       [in] PP_CompletionCallback callback);
     44 
     45  /**
     46   * This function displays a previously created file chooser resource as a
     47   * dialog box, prompting the user to choose a file or files to open, or a
     48   * single file for saving. The callback is called with PP_OK on successful
     49   * completion with a file (or files) selected or PP_ERROR_USERCANCEL if the
     50   * user selected no file.
     51   *
     52   * @param[in] chooser The file chooser resource.
     53   * @param[in] save_as A <code>PP_Bool</code> value indicating if this dialog
     54   * is choosing a file for saving.
     55   * @param[in] suggested_file_name If saving, the suggested name for the
     56   * file, otherwise, null or undefined.
     57   * @param[in] callback A <code>CompletionCallback</code> to be called after
     58   * the user has closed the file chooser dialog.
     59   *
     60   * @return PP_OK_COMPLETIONPENDING if request to show the dialog was
     61   * successful, another error code from pp_errors.h on failure.
     62   */
     63   [version=0.6]
     64   int32_t ShowWithoutUserGesture(
     65       [in] PP_Resource chooser,
     66       [in] PP_Bool save_as,
     67       [in] PP_Var suggested_file_name,
     68       [in] PP_ArrayOutput output,
     69       [in] PP_CompletionCallback callback);
     70 };
     71 
     72