Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: components/renderer_context_menu/render_view_context_menu_base.h

Issue 453993002: IsCommandIdEnabled should not fall though if the base did handle the command id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 isenabled.
84 bool GetCommandIdEnabled(int command_id, bool* enabled) const;
sky 2014/08/08 19:15:25 Were you going to rename this to IsCommandIdKnown
oshima 2014/08/08 20:42:40 oops, I missed that part. Done.
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698