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

Unified Diff: components/renderer_context_menu/render_view_context_menu_base.cc

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 side-by-side diff with in-line comments
Download patch
Index: components/renderer_context_menu/render_view_context_menu_base.cc
diff --git a/components/renderer_context_menu/render_view_context_menu_base.cc b/components/renderer_context_menu/render_view_context_menu_base.cc
index 3d0f89a012d185cca6c90a72a1ed5a990fb88a22..aa47c91f356dab44793e117c5be581f6a9fbe5e3 100644
--- a/components/renderer_context_menu/render_view_context_menu_base.cc
+++ b/components/renderer_context_menu/render_view_context_menu_base.cc
@@ -250,25 +250,31 @@ bool RenderViewContextMenuBase::AppendCustomItems() {
return total_items > 0;
}
-// Menu delegate functions -----------------------------------------------------
-
-bool RenderViewContextMenuBase::IsCommandIdEnabled(int id) const {
+bool RenderViewContextMenuBase::IsCommandIdKnown(
+ int id,
+ bool* enabled) const {
// If this command is is added by one of our observers, we dispatch
// it to the observer.
ObserverListBase<RenderViewContextMenuObserver>::Iterator it(observers_);
RenderViewContextMenuObserver* observer;
while ((observer = it.GetNext()) != NULL) {
- if (observer->IsCommandIdSupported(id))
- return observer->IsCommandIdEnabled(id);
+ if (observer->IsCommandIdSupported(id)) {
+ *enabled = observer->IsCommandIdEnabled(id);
+ return true;
+ }
}
// Custom items.
- if (IsContentCustomCommandId(id))
- return IsCustomItemEnabled(id);
+ if (IsContentCustomCommandId(id)) {
+ *enabled = IsCustomItemEnabled(id);
+ return true;
+ }
return false;
}
+// Menu delegate functions -----------------------------------------------------
+
bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const {
// If this command is is added by one of our observers, we dispatch it to the
// observer.

Powered by Google App Engine
This is Rietveld 408576698