| 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_RENDER_VIEW_CONTEXT_MENU_BASE_H_ | 5 #ifndef COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ |
| 6 #define COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ | 6 #define COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static int ConvertToContentCustomCommandId(int id); | 62 static int ConvertToContentCustomCommandId(int id); |
| 63 | 63 |
| 64 // True if the given id is the one generated for content context menu. | 64 // True if the given id is the one generated for content context menu. |
| 65 static bool IsContentCustomCommandId(int id); | 65 static bool IsContentCustomCommandId(int id); |
| 66 | 66 |
| 67 RenderViewContextMenuBase(content::RenderFrameHost* render_frame_host, | 67 RenderViewContextMenuBase(content::RenderFrameHost* render_frame_host, |
| 68 const content::ContextMenuParams& params); | 68 const content::ContextMenuParams& params); |
| 69 | 69 |
| 70 ~RenderViewContextMenuBase() override; | 70 ~RenderViewContextMenuBase() override; |
| 71 | 71 |
| 72 // Displays the menu. |
| 73 // Different platform will have their own implementation. |
| 74 virtual void Show() = 0; |
| 75 |
| 72 // Initializes the context menu. | 76 // Initializes the context menu. |
| 73 void Init(); | 77 void Init(); |
| 74 | 78 |
| 75 // Programmatically closes the context menu. | 79 // Programmatically closes the context menu. |
| 76 void Cancel(); | 80 void Cancel(); |
| 77 | 81 |
| 78 const ui::SimpleMenuModel& menu_model() const { return menu_model_; } | 82 const ui::SimpleMenuModel& menu_model() const { return menu_model_; } |
| 79 const content::ContextMenuParams& params() const { return params_; } | 83 const content::ContextMenuParams& params() const { return params_; } |
| 80 | 84 |
| 81 // Returns true if the specified command id is known and valid for | 85 // Returns true if the specified command id is known and valid for |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 185 |
| 182 // The RenderFrameHost's IDs. | 186 // The RenderFrameHost's IDs. |
| 183 int render_process_id_; | 187 int render_process_id_; |
| 184 | 188 |
| 185 scoped_ptr<ToolkitDelegate> toolkit_delegate_; | 189 scoped_ptr<ToolkitDelegate> toolkit_delegate_; |
| 186 | 190 |
| 187 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); | 191 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); |
| 188 }; | 192 }; |
| 189 | 193 |
| 190 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ | 194 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ |
| OLD | NEW |