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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 751823004: 'Paste' & 'Paste as plain text' should check edit_flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nit. Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698