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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Initializes the context menu. | 72 // Initializes the context menu. |
73 void Init(); | 73 void Init(); |
74 | 74 |
75 // Programmatically closes the context menu. | 75 // Programmatically closes the context menu. |
76 void Cancel(); | 76 void Cancel(); |
77 | 77 |
78 const ui::SimpleMenuModel& menu_model() const { return menu_model_; } | 78 const ui::SimpleMenuModel& menu_model() const { return menu_model_; } |
79 const content::ContextMenuParams& params() const { return params_; } | 79 const content::ContextMenuParams& params() const { return params_; } |
80 | 80 |
| 81 // Returns true if the specified command id is known and valid for |
| 82 // this menu. If the command is known |enabled| is set to indicate |
| 83 // if the command is enabled. |
| 84 bool IsCommandIdKnown(int command_id, bool* enabled) const; |
| 85 |
81 // SimpleMenuModel::Delegate implementation. | 86 // SimpleMenuModel::Delegate implementation. |
82 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 87 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
83 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | |
84 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 88 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
85 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; | 89 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; |
86 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; | 90 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; |
87 | 91 |
88 // RenderViewContextMenuProxy implementation. | 92 // RenderViewContextMenuProxy implementation. |
89 virtual void AddMenuItem(int command_id, | 93 virtual void AddMenuItem(int command_id, |
90 const base::string16& title) OVERRIDE; | 94 const base::string16& title) OVERRIDE; |
91 virtual void AddCheckItem(int command_id, | 95 virtual void AddCheckItem(int command_id, |
92 const base::string16& title) OVERRIDE; | 96 const base::string16& title) OVERRIDE; |
93 virtual void AddSeparator() OVERRIDE; | 97 virtual void AddSeparator() OVERRIDE; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // The RenderFrameHost's IDs. | 181 // The RenderFrameHost's IDs. |
178 int render_process_id_; | 182 int render_process_id_; |
179 int render_frame_id_; | 183 int render_frame_id_; |
180 | 184 |
181 scoped_ptr<ToolkitDelegate> toolkit_delegate_; | 185 scoped_ptr<ToolkitDelegate> toolkit_delegate_; |
182 | 186 |
183 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); | 187 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); |
184 }; | 188 }; |
185 | 189 |
186 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ | 190 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ |
OLD | NEW |