Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / components / renderer_context_menu / context_menu_delegate.h
blob57327b16cb9b084622d8941d344bbab35555c72e
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 RenderViewContextMenu;
12 namespace content {
13 class WebContents;
14 struct ContextMenuParams;
17 // A ContextMenuDelegate can build and show renderer context menu.
18 class ContextMenuDelegate {
19 public:
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<RenderViewContextMenu> BuildMenu(
29 content::WebContents* web_contents,
30 const content::ContextMenuParams& params) = 0;
32 // Displays the context menu.
33 virtual void ShowMenu(scoped_ptr<RenderViewContextMenu> menu) = 0;
35 private:
36 DISALLOW_COPY_AND_ASSIGN(ContextMenuDelegate);
39 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_