1 // Copyright 2014 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 COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_
6 #define COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
10 class RenderViewContextMenuBase
;
14 struct ContextMenuParams
;
17 // A ContextMenuDelegate can build and show renderer context menu.
18 class ContextMenuDelegate
{
20 explicit ContextMenuDelegate(content::WebContents
* web_contents
);
21 virtual ~ContextMenuDelegate();
23 static ContextMenuDelegate
* FromWebContents(
24 content::WebContents
* web_contents
);
26 // Builds and returns a context menu for a context specified by |params|.
27 // The returned value can be used to display the context menu.
28 virtual scoped_ptr
<RenderViewContextMenuBase
> BuildMenu(
29 content::WebContents
* web_contents
,
30 const content::ContextMenuParams
& params
) = 0;
32 // Displays the context menu.
33 virtual void ShowMenu(scoped_ptr
<RenderViewContextMenuBase
> menu
) = 0;
36 DISALLOW_COPY_AND_ASSIGN(ContextMenuDelegate
);
39 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_