Chromium Code Reviews| 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..0659b20c73c14569ce9a5b2cdd2a55b4c2294b97 |
| --- /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 OnCustomContextMenuAction(int request_id, unsigned action) = 0; |
|
jam
2012/10/10 04:01:43
nit: since ContextMenu is in the interface name, i
brettw
2012/10/10 05:10:17
I was originally thinking this would be implemente
|
| + |
| + // Called when the context menu is closed. The request ID will be the value |
| + // returned by RenderView.ShowCustomContextMenu. |
| + virtual void OnCustomContextMenuClosed(int request_id) = 0; |
| + |
| + protected: |
| + virtual ~ContextMenuClient() {} |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_ |