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

Unified Diff: ppapi/c/private/ppb_flash_menu.h

Issue 6253017: Pepper/Flapper: First pass at context menu implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/c/private/ppb_flash_menu.h
diff --git a/ppapi/c/private/ppb_flash_menu.h b/ppapi/c/private/ppb_flash_menu.h
new file mode 100644
index 0000000000000000000000000000000000000000..a183baf586af295bef98ec801e49e1c359d13ba3
--- /dev/null
+++ b/ppapi/c/private/ppb_flash_menu.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_
+#define PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_
+
+#include "ppapi/c/pp_bool.h"
+#include "ppapi/c/pp_instance.h"
+#include "ppapi/c/pp_point.h"
+#include "ppapi/c/pp_resource.h"
+
+// PPB_Flash -------------------------------------------------------------------
+
+#define PPB_FLASH_MENU_INTERFACE "PPB_Flash_Menu;1"
+
+struct PP_CompletionCallback;
+
+typedef enum {
+ // TODO(viettrungluu): Radio items not supported yet. Will also probably want
+ // special menu items tied to clipboard access.
+ PP_FLASH_MENUITEM_TYPE_NORMAL = 0,
+ PP_FLASH_MENUITEM_TYPE_CHECKBOX,
+ PP_FLASH_MENUITEM_TYPE_SEPARATOR,
+ PP_FLASH_MENUITEM_TYPE_SUBMENU
+} PP_Flash_MenuItem_Type;
+
+struct PP_Flash_MenuItem {
+ PP_Flash_MenuItem_Type type;
+ char* name;
+ int32_t id;
+ PP_Bool enabled;
+ PP_Bool checked;
+ struct PP_Flash_Menu* submenu;
+};
+
+struct PP_Flash_Menu {
+ uint32_t count;
+ struct PP_Flash_MenuItem* items;
+};
+
+struct PPB_Flash_Menu {
+ PP_Resource (*Create)(PP_Instance instance_id,
+ const struct PP_Flash_Menu* menu_data);
+ PP_Bool (*IsFlashMenu)(PP_Resource resource_id);
+
+ // Display a context menu at the given location. If the user selects an item,
+ // |selected_id| will be set to its |id| and the callback called with |PP_OK|.
+ // If the user dismisses the menu without selecting an item,
+ // |PP_ERROR_USERCANCEL| will be indicated.
+ int32_t (*Show)(PP_Resource menu_id,
+ const struct PP_Point* location,
+ int32_t* selected_id,
+ PP_CompletionCallback callback);
+};
+
+#endif // PPAPI_C_PRIVATE_PPB_FLASH_MENU_H_

Powered by Google App Engine
This is Rietveld 408576698