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. |