Add owners for offlinepages
[chromium-blink-merge.git] / components / renderer_context_menu / context_menu_delegate.h
blobf592dcc591bdbdfb690746e94c9b57f50b42a25d
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;
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<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;
35 private:
36 DISALLOW_COPY_AND_ASSIGN(ContextMenuDelegate);
39 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_