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

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

Issue 766633004: 'Paste as plain text' should not come when we does not have the plain text in clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 52e6e04639eff8d1bb4d08eb15a9ba932e96efb5..04a89ad07fd68c95ce597443d2b043ec2b08a08b 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1197,14 +1197,20 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
case IDC_CONTENT_CONTEXT_COPY:
return !!(params_.edit_flags & WebContextMenuData::CanCopy);
- case IDC_CONTENT_CONTEXT_PASTE:
- case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE: {
+ case IDC_CONTENT_CONTEXT_PASTE: {
std::vector<base::string16> types;
bool ignore;
ui::Clipboard::GetForCurrentThread()->ReadAvailableTypes(
ui::CLIPBOARD_TYPE_COPY_PASTE, &types, &ignore);
return !types.empty();
}
+
+ case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE: {
+ return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable(
+ ui::Clipboard::GetPlainTextFormatType(),
+ ui::CLIPBOARD_TYPE_COPY_PASTE);
+ }
+
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