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

Unified Diff: chrome/browser/cocoa/web_drag_source.mm

Issue 174364: Plumb the DragOperation through all the layers between the platform DnD code ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « chrome/browser/cocoa/web_drag_source.h ('k') | chrome/browser/cocoa/web_drop_target.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « chrome/browser/cocoa/web_drag_source.h ('k') | chrome/browser/cocoa/web_drop_target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698