| Index: chrome/browser/cocoa/web_drag_source.mm
|
| ===================================================================
|
| --- chrome/browser/cocoa/web_drag_source.mm (revision 25321)
|
| +++ chrome/browser/cocoa/web_drag_source.mm (working copy)
|
| @@ -122,7 +122,8 @@
|
|
|
| - (id)initWithContentsView:(TabContentsViewCocoa*)contentsView
|
| dropData:(const WebDropData*)dropData
|
| - pasteboard:(NSPasteboard*)pboard {
|
| + pasteboard:(NSPasteboard*)pboard
|
| + dragOperationMask:(NSDragOperation)dragOperationMask {
|
| if ((self = [super init])) {
|
| contentsView_ = contentsView;
|
| DCHECK(contentsView_);
|
| @@ -133,12 +134,18 @@
|
| pasteboard_.reset([pboard retain]);
|
| DCHECK(pasteboard_.get());
|
|
|
| + dragOperationMask_ = dragOperationMask;
|
| +
|
| [self fillPasteboard];
|
| }
|
|
|
| return self;
|
| }
|
|
|
| +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal {
|
| + return dragOperationMask_;
|
| +}
|
| +
|
| - (void)lazyWriteToPasteboard:(NSPasteboard*)pboard forType:(NSString*)type {
|
| // Be extra paranoid; avoid crashing.
|
| if (!dropData_.get()) {
|
| @@ -226,7 +233,7 @@
|
| }
|
|
|
| - (void)endDragAt:(NSPoint)screenPoint
|
| - isCancelled:(BOOL)cancelled {
|
| + operation:(NSDragOperation)operation {
|
| RenderViewHost* rvh = [contentsView_ tabContents]->render_view_host();
|
| if (rvh) {
|
| rvh->DragSourceSystemDragEnded();
|
| @@ -239,13 +246,9 @@
|
| NSRect screenFrame = [[[contentsView_ window] screen] frame];
|
| screenPoint.y = screenFrame.size.height - screenPoint.y;
|
|
|
| - if (cancelled) {
|
| - rvh->DragSourceCancelledAt(localPoint.x, localPoint.y,
|
| - screenPoint.x, screenPoint.y);
|
| - } else {
|
| - rvh->DragSourceEndedAt(localPoint.x, localPoint.y,
|
| - screenPoint.x, screenPoint.y);
|
| - }
|
| + rvh->DragSourceEndedAt(localPoint.x, localPoint.y,
|
| + screenPoint.x, screenPoint.y,
|
| + static_cast<WebKit::WebDragOperation>(operation));
|
| }
|
|
|
| // Make sure the pasteboard owner isn't us.
|
|
|