| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_ | 5 #ifndef COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_ |
| 6 #define COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_ | 6 #define COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 class RenderViewContextMenu; | 10 class RenderViewContextMenuBase; |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 struct ContextMenuParams; | 14 struct ContextMenuParams; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // A ContextMenuDelegate can build and show renderer context menu. | 17 // A ContextMenuDelegate can build and show renderer context menu. |
| 18 class ContextMenuDelegate { | 18 class ContextMenuDelegate { |
| 19 public: | 19 public: |
| 20 explicit ContextMenuDelegate(content::WebContents* web_contents); | 20 explicit ContextMenuDelegate(content::WebContents* web_contents); |
| 21 virtual ~ContextMenuDelegate(); | 21 virtual ~ContextMenuDelegate(); |
| 22 | 22 |
| 23 static ContextMenuDelegate* FromWebContents( | 23 static ContextMenuDelegate* FromWebContents( |
| 24 content::WebContents* web_contents); | 24 content::WebContents* web_contents); |
| 25 | 25 |
| 26 // Builds and returns a context menu for a context specified by |params|. | 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. | 27 // The returned value can be used to display the context menu. |
| 28 virtual scoped_ptr<RenderViewContextMenu> BuildMenu( | 28 virtual scoped_ptr<RenderViewContextMenuBase> BuildMenu( |
| 29 content::WebContents* web_contents, | 29 content::WebContents* web_contents, |
| 30 const content::ContextMenuParams& params) = 0; | 30 const content::ContextMenuParams& params) = 0; |
| 31 | 31 |
| 32 // Displays the context menu. | 32 // Displays the context menu. |
| 33 virtual void ShowMenu(scoped_ptr<RenderViewContextMenu> menu) = 0; | 33 virtual void ShowMenu(scoped_ptr<RenderViewContextMenuBase> menu) = 0; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(ContextMenuDelegate); | 36 DISALLOW_COPY_AND_ASSIGN(ContextMenuDelegate); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_ | 39 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_CONTEXT_MENU_DELEGATE_H_ |
| OLD | NEW |