Home | History | Annotate | Download | only in private
      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  * This file defines the <code>PPB_Flash_Menu</code> interface.
      8  */
      9 label Chrome {
     10   M14 = 0.2
     11 };
     12 
     13 /* Menu item type.
     14  *
     15  * TODO(viettrungluu): Radio items not supported yet. Will also probably want
     16  * special menu items tied to clipboard access.
     17  */
     18 [assert_size(4)]
     19 enum PP_Flash_MenuItem_Type {
     20   PP_FLASH_MENUITEM_TYPE_NORMAL = 0,
     21   PP_FLASH_MENUITEM_TYPE_CHECKBOX = 1,
     22   PP_FLASH_MENUITEM_TYPE_SEPARATOR = 2,
     23   PP_FLASH_MENUITEM_TYPE_SUBMENU = 3
     24 };
     25 
     26 struct PP_Flash_MenuItem {
     27   PP_Flash_MenuItem_Type type;
     28   str_t name;
     29   int32_t id;
     30   PP_Bool enabled;
     31   PP_Bool checked;
     32   [ref] PP_Flash_Menu submenu;
     33 };
     34 
     35 struct PP_Flash_Menu {
     36   uint32_t count;
     37   [size_is(count)] PP_Flash_MenuItem[] items;
     38 };
     39 
     40 interface PPB_Flash_Menu {
     41   PP_Resource Create([in] PP_Instance instance_id,
     42                      [in] PP_Flash_Menu menu_data);
     43   PP_Bool IsFlashMenu(PP_Resource resource_id);
     44   /* Display a context menu at the given location. If the user selects an item,
     45    * |selected_id| will be set to its |id| and the callback called with |PP_OK|.
     46    * If the user dismisses the menu without selecting an item,
     47    * |PP_ERROR_USERCANCEL| will be indicated.
     48    */
     49   int32_t Show([in] PP_Resource menu_id,
     50                [in] PP_Point location,
     51                [out] int32_t selected_id,
     52                [in] PP_CompletionCallback callback);
     53 };
     54 
     55