| Index: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| index 03772a7b444d0c8704633a5c36e56cc5c05b2ec2..da67273b100e9519ea573f8fe220e90803277a22 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
|
| @@ -663,7 +663,7 @@ static bool ExecuteCopy(LocalFrame& frame,
|
| // |canExecute()|. See also "Cut", and "Paste" command.
|
| if (!CanWriteClipboard(frame, source))
|
| return false;
|
| - frame.GetEditor().Copy();
|
| + frame.GetEditor().Copy(source);
|
| return true;
|
| }
|
|
|
| @@ -2044,12 +2044,18 @@ static bool EnableCaretInEditableText(LocalFrame& frame,
|
| static bool EnabledCopy(LocalFrame& frame, Event*, EditorCommandSource source) {
|
| if (!CanWriteClipboard(frame, source))
|
| return false;
|
| + if (source == kCommandFromMenuOrKeyBinding &&
|
| + !frame.Selection().SelectionHasFocus())
|
| + return false;
|
| return frame.GetEditor().CanDHTMLCopy() || frame.GetEditor().CanCopy();
|
| }
|
|
|
| static bool EnabledCut(LocalFrame& frame, Event*, EditorCommandSource source) {
|
| if (!CanWriteClipboard(frame, source))
|
| return false;
|
| + if (source == kCommandFromMenuOrKeyBinding &&
|
| + !frame.Selection().SelectionHasFocus())
|
| + return false;
|
| return frame.GetEditor().CanDHTMLCut() || frame.GetEditor().CanCut();
|
| }
|
|
|
| @@ -2101,6 +2107,9 @@ static bool EnabledPaste(LocalFrame& frame,
|
| EditorCommandSource source) {
|
| if (!CanReadClipboard(frame, source))
|
| return false;
|
| + if (source == kCommandFromMenuOrKeyBinding &&
|
| + !frame.Selection().SelectionHasFocus())
|
| + return false;
|
| return frame.GetEditor().CanPaste();
|
| }
|
|
|
|
|