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

Unified Diff: content/public/renderer/context_menu_client.h

Issue 11083002: Allow custom context menus to be requested. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « content/content_renderer.gypi ('k') | content/public/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/context_menu_client.h
diff --git a/content/public/renderer/context_menu_client.h b/content/public/renderer/context_menu_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..ceb10a0afda892e790ad4de9cde1cbfb05339505
--- /dev/null
+++ b/content/public/renderer/context_menu_client.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 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 CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_
+#define CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_
+
+#include "base/basictypes.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+// This mirrors the WebKit API in that the "action selected" and "menu closed"
+// events are separate. When the user selects and item you'll get both events.
+// If the user clicks somewhere else and cancels the menu, you'll just get the
+// "closed" event.
+class CONTENT_EXPORT ContextMenuClient {
+ public:
+ // Called when the user selects a context menu item. The request ID will be
+ // the value returned by RenderView.ShowCustomContextMenu. This will be
+ // followed by a call to OnCustomContextMenuClosed.
+ virtual void OnMenuAction(int request_id, unsigned action) = 0;
+
+ // Called when the context menu is closed. The request ID will be the value
+ // returned by RenderView.ShowCustomContextMenu.
+ virtual void OnMenuClosed(int request_id) = 0;
+
+ protected:
+ virtual ~ContextMenuClient() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698