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

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

Issue 443073002: Added code to disable 'paste' if nothing is present in clipboard to paste. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« 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 7d7207c41db64c03a951433bbebdc06d793eac99..732aa8c6db5d3a0a35208d8cc0c8e878caeb0bdb 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1370,9 +1370,13 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
return !!(params_.edit_flags & WebContextMenuData::CanCopy);
case IDC_CONTENT_CONTEXT_PASTE:
- case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE:
- return !!(params_.edit_flags & WebContextMenuData::CanPaste);
-
+ case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE: {
+ std::vector<base::string16> types;
+ bool ignore;
+ ui::Clipboard::GetForCurrentThread()->ReadAvailableTypes(
darin (slow to review) 2014/08/06 16:31:33 This is potentially an expensive call, right? Shou
+ ui::CLIPBOARD_TYPE_COPY_PASTE, &types, &ignore);
+ return !types.empty();
+ }
case IDC_CONTENT_CONTEXT_DELETE:
return !!(params_.edit_flags & WebContextMenuData::CanDelete);
« 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