OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |