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.
7 * This file defines the <code>PPB_Flash_Menu</code> interface.
15 * TODO(viettrungluu): Radio items not supported yet. Will also probably want
16 * special menu items tied to clipboard access.
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
26 struct PP_Flash_MenuItem
{
27 PP_Flash_MenuItem_Type type
;
32 [ref] PP_Flash_Menu submenu
;
35 struct PP_Flash_Menu
{
37 [size_is(count
)] PP_Flash_MenuItem
[] items
;
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.
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);