void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame) { PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); GtkClipboard* clipboard = helper->getClipboard(frame); DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); dataObject->setText(frame->editor()->selectedText()); dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, ResolveNonLocalURLs)); helper->writeClipboardContents(clipboard, canSmartCopyOrDelete ? PasteboardHelper::IncludeSmartPaste : PasteboardHelper::DoNotIncludeSmartPaste); }
void Pasteboard::writeURL(const KURL& url, const String& label, Frame* frame) { if (url.isEmpty()) return; PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); GtkClipboard* clipboard = helper->getClipboard(frame); DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); dataObject->setURL(url, label); helper->writeClipboardContents(clipboard); }