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

Unified Diff: webkit/plugins/ppapi/ppb_flash_menu_impl.h

Issue 6253017: Pepper/Flapper: First pass at context menu implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make brettw happier 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
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_impl.cc ('k') | webkit/plugins/ppapi/ppb_flash_menu_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_flash_menu_impl.h
diff --git a/webkit/plugins/ppapi/ppb_flash_menu_impl.h b/webkit/plugins/ppapi/ppb_flash_menu_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..610e46e85ae3a364f0ffcb426775eeac44788c3c
--- /dev/null
+++ b/webkit/plugins/ppapi/ppb_flash_menu_impl.h
@@ -0,0 +1,65 @@
+// 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 WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_
+#define WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/ref_counted.h"
+#include "ppapi/c/pp_point.h"
+#include "ppapi/c/private/ppb_flash_menu.h"
+#include "webkit/plugins/ppapi/callbacks.h"
+#include "webkit/plugins/ppapi/resource.h"
+
+struct WebMenuItem;
+
+namespace webkit {
+namespace ppapi {
+
+class PPB_Flash_Menu_Impl : public Resource {
+ public:
+ explicit PPB_Flash_Menu_Impl(PluginInstance* instance);
+ virtual ~PPB_Flash_Menu_Impl();
+
+ static const PPB_Flash_Menu* GetInterface();
+
+ bool Init(const PP_Flash_Menu* menu_data);
+
+ // Resource override.
+ virtual PPB_Flash_Menu_Impl* AsPPB_Flash_Menu_Impl();
+
+ // PPB_Flash_Menu implementation.
+ int32_t Show(const PP_Point* location,
+ int32_t* selected_id_out,
+ PP_CompletionCallback callback);
+
+ // Called to complete |Show()|.
+ void CompleteShow(int32_t result, unsigned action);
+
+ typedef std::vector<WebMenuItem> MenuData;
+ const MenuData& menu_data() const { return menu_data_; }
+
+ private:
+ MenuData menu_data_;
+
+ // We send |WebMenuItem|s, which have an |unsigned| "action" field instead of
+ // an |int32_t| ID. (Chrome also limits the range of valid values for
+ // actions.) This maps actions to IDs.
+ std::vector<int32_t> menu_id_map_;
+
+ // Any pending callback (for |Show()|).
+ scoped_refptr<TrackedCompletionCallback> callback_;
+
+ // Output buffers to be filled in when the callback is completed successfully.
+ int32_t* selected_id_out_;
+
+ DISALLOW_COPY_AND_ASSIGN(PPB_Flash_Menu_Impl);
+};
+
+} // namespace ppapi
+} // namespace webkit
+
+#endif // WEBKIT_PLUGINS_PPAPI_PPB_FLASH_MENU_IMPL_H_
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_impl.cc ('k') | webkit/plugins/ppapi/ppb_flash_menu_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698