diff options
Diffstat (limited to 'WebCore/platform/mac/ClipboardMac.mm')
-rw-r--r-- | WebCore/platform/mac/ClipboardMac.mm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/WebCore/platform/mac/ClipboardMac.mm b/WebCore/platform/mac/ClipboardMac.mm index ddfa0d5..0cbb3f6 100644 --- a/WebCore/platform/mac/ClipboardMac.mm +++ b/WebCore/platform/mac/ClipboardMac.mm @@ -29,6 +29,7 @@ #import "DOMElementInternal.h" #import "DragClient.h" #import "DragController.h" +#import "DragData.h" #import "Editor.h" #import "FoundationExtras.h" #import "FileList.h" @@ -37,6 +38,7 @@ #import "Page.h" #import "Pasteboard.h" #import "RenderImage.h" +#import "ScriptExecutionContext.h" #import "SecurityOrigin.h" #import "WebCoreSystemInterface.h" @@ -46,6 +48,11 @@ typedef unsigned NSUInteger; namespace WebCore { +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy policy, DragData* dragData, Frame* frame) +{ + return ClipboardMac::create(true, [dragData->platformData() draggingPasteboard], policy, frame); +} + ClipboardMac::ClipboardMac(bool forDragging, NSPasteboard *pasteboard, ClipboardAccessPolicy policy, Frame *frame) : Clipboard(policy, forDragging) , m_pasteboard(pasteboard) @@ -306,11 +313,12 @@ PassRefPtr<FileList> ClipboardMac::files() const NSArray *absoluteURLs = absoluteURLsFromPasteboardFilenames(m_pasteboard.get()); NSUInteger count = [absoluteURLs count]; + ScriptExecutionContext* scriptExecutionContext = m_frame->document()->scriptExecutionContext(); RefPtr<FileList> fileList = FileList::create(); for (NSUInteger x = 0; x < count; x++) { NSURL *absoluteURL = [NSURL URLWithString:[absoluteURLs objectAtIndex:x]]; ASSERT([absoluteURL isFileURL]); - fileList->append(File::create([absoluteURL path])); + fileList->append(File::create(scriptExecutionContext, [absoluteURL path])); } return fileList.release(); // We will always return a FileList, sometimes empty } |