Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / public / renderer / context_menu_client.h
blobceb10a0afda892e790ad4de9cde1cbfb05339505
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.
5 #ifndef CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_
6 #define CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_
8 #include "base/basictypes.h"
9 #include "content/common/content_export.h"
11 namespace content {
13 // This mirrors the WebKit API in that the "action selected" and "menu closed"
14 // events are separate. When the user selects and item you'll get both events.
15 // If the user clicks somewhere else and cancels the menu, you'll just get the
16 // "closed" event.
17 class CONTENT_EXPORT ContextMenuClient {
18 public:
19 // Called when the user selects a context menu item. The request ID will be
20 // the value returned by RenderView.ShowCustomContextMenu. This will be
21 // followed by a call to OnCustomContextMenuClosed.
22 virtual void OnMenuAction(int request_id, unsigned action) = 0;
24 // Called when the context menu is closed. The request ID will be the value
25 // returned by RenderView.ShowCustomContextMenu.
26 virtual void OnMenuClosed(int request_id) = 0;
28 protected:
29 virtual ~ContextMenuClient() {}
32 } // namespace content
34 #endif // CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_