Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc |
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc |
index 04a89ad07fd68c95ce597443d2b043ec2b08a08b..dcb6fd8292bb44b5bae0211554b50bd5ec1c3a21 100644 |
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc |
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc |
@@ -1198,6 +1198,9 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { |
return !!(params_.edit_flags & WebContextMenuData::CanCopy); |
case IDC_CONTENT_CONTEXT_PASTE: { |
+ if (!(params_.edit_flags & WebContextMenuData::CanPaste)) |
+ return false; |
+ |
std::vector<base::string16> types; |
bool ignore; |
ui::Clipboard::GetForCurrentThread()->ReadAvailableTypes( |
@@ -1206,6 +1209,9 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { |
} |
case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE: { |
+ if (!(params_.edit_flags & WebContextMenuData::CanPaste)) |
+ return false; |
+ |
return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable( |
ui::Clipboard::GetPlainTextFormatType(), |
ui::CLIPBOARD_TYPE_COPY_PASTE); |