Chromium Code Reviews| 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 // Sets the state of the command id in |enabled|. The function | |
| 82 // returns true if the command id is handled. | |
| 83 bool GetCommandIdEnabled(int command_id, bool* enabled) const; | |
|
sky
2014/08/08 16:36:23
The description you have here and the name is mild
oshima
2014/08/08 17:14:17
Done.
| |
| 84 | |
| 81 // SimpleMenuModel::Delegate implementation. | 85 // SimpleMenuModel::Delegate implementation. |
| 82 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 86 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; | 87 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; |
| 85 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; | 88 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; |
| 86 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; | 89 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; |
| 87 | 90 |
| 88 // RenderViewContextMenuProxy implementation. | 91 // RenderViewContextMenuProxy implementation. |
| 89 virtual void AddMenuItem(int command_id, | 92 virtual void AddMenuItem(int command_id, |
| 90 const base::string16& title) OVERRIDE; | 93 const base::string16& title) OVERRIDE; |
| 91 virtual void AddCheckItem(int command_id, | 94 virtual void AddCheckItem(int command_id, |
| 92 const base::string16& title) OVERRIDE; | 95 const base::string16& title) OVERRIDE; |
| 93 virtual void AddSeparator() OVERRIDE; | 96 virtual void AddSeparator() OVERRIDE; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // The RenderFrameHost's IDs. | 180 // The RenderFrameHost's IDs. |
| 178 int render_process_id_; | 181 int render_process_id_; |
| 179 int render_frame_id_; | 182 int render_frame_id_; |
| 180 | 183 |
| 181 scoped_ptr<ToolkitDelegate> toolkit_delegate_; | 184 scoped_ptr<ToolkitDelegate> toolkit_delegate_; |
| 182 | 185 |
| 183 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); | 186 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ | 189 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ |
| OLD | NEW |