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

Unified Diff: Source/core/editing/Editor.cpp

Issue 410873005: Added code to disable 'paste' if nothing is present in clipboard to paste. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index adb58dbcd3518a79a9e837160f46bc8b12b6a29d..9a3ded5e744c4218214f7f1414458b2eab3328fb 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -239,7 +239,10 @@ bool Editor::canCopy() const
bool Editor::canPaste() const
{
- return canEdit();
+ if (!canEdit())
+ return false;
+ String text = Pasteboard::generalPasteboard()->plainText();
jamesr 2014/07/24 18:27:15 this is going to do a synchronous IPC to the brows
+ return !text.isEmpty();
}
bool Editor::canDelete() const
« 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