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"
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
17 class CONTENT_EXPORT ContextMenuClient
{
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;
29 virtual ~ContextMenuClient() {}
32 } // namespace content
34 #endif // CONTENT_PUBLIC_RENDERER_CONTEXT_MENU_CLIENT_H_