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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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 | 82 // this menu. If the command is known |enabled| is set to indicate |
83 // if the command is enabled. | 83 // if the command is enabled. |
84 bool IsCommandIdKnown(int command_id, bool* enabled) const; | 84 bool IsCommandIdKnown(int command_id, bool* enabled) const; |
85 | 85 |
86 // SimpleMenuModel::Delegate implementation. | 86 // SimpleMenuModel::Delegate implementation. |
87 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 87 virtual bool IsCommandIdChecked(int command_id) const override; |
88 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 88 virtual void ExecuteCommand(int command_id, int event_flags) override; |
89 virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE; | 89 virtual void MenuWillShow(ui::SimpleMenuModel* source) override; |
90 virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE; | 90 virtual void MenuClosed(ui::SimpleMenuModel* source) override; |
91 | 91 |
92 // RenderViewContextMenuProxy implementation. | 92 // RenderViewContextMenuProxy implementation. |
93 virtual void AddMenuItem(int command_id, | 93 virtual void AddMenuItem(int command_id, |
94 const base::string16& title) OVERRIDE; | 94 const base::string16& title) override; |
95 virtual void AddCheckItem(int command_id, | 95 virtual void AddCheckItem(int command_id, |
96 const base::string16& title) OVERRIDE; | 96 const base::string16& title) override; |
97 virtual void AddSeparator() OVERRIDE; | 97 virtual void AddSeparator() override; |
98 virtual void AddSubMenu(int command_id, | 98 virtual void AddSubMenu(int command_id, |
99 const base::string16& label, | 99 const base::string16& label, |
100 ui::MenuModel* model) OVERRIDE; | 100 ui::MenuModel* model) override; |
101 virtual void UpdateMenuItem(int command_id, | 101 virtual void UpdateMenuItem(int command_id, |
102 bool enabled, | 102 bool enabled, |
103 bool hidden, | 103 bool hidden, |
104 const base::string16& title) OVERRIDE; | 104 const base::string16& title) override; |
105 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; | 105 virtual content::RenderViewHost* GetRenderViewHost() const override; |
106 virtual content::WebContents* GetWebContents() const OVERRIDE; | 106 virtual content::WebContents* GetWebContents() const override; |
107 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; | 107 virtual content::BrowserContext* GetBrowserContext() const override; |
108 | 108 |
109 protected: | 109 protected: |
110 friend class RenderViewContextMenuTest; | 110 friend class RenderViewContextMenuTest; |
111 friend class RenderViewContextMenuPrefsTest; | 111 friend class RenderViewContextMenuPrefsTest; |
112 | 112 |
113 void set_content_type(ContextMenuContentType* content_type) { | 113 void set_content_type(ContextMenuContentType* content_type) { |
114 content_type_.reset(content_type); | 114 content_type_.reset(content_type); |
115 } | 115 } |
116 | 116 |
117 void set_toolkit_delegate(scoped_ptr<ToolkitDelegate> delegate) { | 117 void set_toolkit_delegate(scoped_ptr<ToolkitDelegate> delegate) { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 // The RenderFrameHost's IDs. | 184 // The RenderFrameHost's IDs. |
185 int render_process_id_; | 185 int render_process_id_; |
186 | 186 |
187 scoped_ptr<ToolkitDelegate> toolkit_delegate_; | 187 scoped_ptr<ToolkitDelegate> toolkit_delegate_; |
188 | 188 |
189 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); | 189 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuBase); |
190 }; | 190 }; |
191 | 191 |
192 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ | 192 #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_BASE_H_ |
OLD | NEW |