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

Side by Side Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 23775005: Go back to the old method of doing file drop promises. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more detail in brokenness Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/web_contents/web_drag_source_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Carbon/Carbon.h> 5 #import <Carbon/Carbon.h>
6 6
7 #import "content/browser/web_contents/web_contents_view_mac.h" 7 #import "content/browser/web_contents/web_contents_view_mac.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 505
506 // Might as well throw out this object now. 506 // Might as well throw out this object now.
507 dragSource_.reset(); 507 dragSource_.reset();
508 } 508 }
509 509
510 // Called when a drag initiated in our view moves. 510 // Called when a drag initiated in our view moves.
511 - (void)draggedImage:(NSImage*)draggedImage movedTo:(NSPoint)screenPoint { 511 - (void)draggedImage:(NSImage*)draggedImage movedTo:(NSPoint)screenPoint {
512 [dragSource_ moveDragTo:screenPoint]; 512 [dragSource_ moveDragTo:screenPoint];
513 } 513 }
514 514
515 // Called when a file drag is dropped and the promised files need to be written.
516 - (NSArray*)namesOfPromisedFilesDroppedAtDestination:(NSURL*)dropDest {
517 if (![dropDest isFileURL])
518 return nil;
519
520 NSString* fileName = [dragSource_ dragPromisedFileTo:[dropDest path]];
521 if (!fileName)
522 return nil;
523
524 return @[ fileName ];
525 }
526
515 // NSDraggingDestination methods 527 // NSDraggingDestination methods
516 528
517 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { 529 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
518 return [dragDest_ draggingEntered:sender view:self]; 530 return [dragDest_ draggingEntered:sender view:self];
519 } 531 }
520 532
521 - (void)draggingExited:(id<NSDraggingInfo>)sender { 533 - (void)draggingExited:(id<NSDraggingInfo>)sender {
522 [dragDest_ draggingExited:sender]; 534 [dragDest_ draggingExited:sender];
523 } 535 }
524 536
(...skipping 30 matching lines...) Expand all
555 [[[notification userInfo] objectForKey:kSelectionDirection] 567 [[[notification userInfo] objectForKey:kSelectionDirection]
556 unsignedIntegerValue]; 568 unsignedIntegerValue];
557 if (direction == NSDirectSelection) 569 if (direction == NSDirectSelection)
558 return; 570 return;
559 571
560 [self webContents]-> 572 [self webContents]->
561 FocusThroughTabTraversal(direction == NSSelectingPrevious); 573 FocusThroughTabTraversal(direction == NSSelectingPrevious);
562 } 574 }
563 575
564 @end 576 @end
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_drag_source_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698