| 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] | 476 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] |
| 477 dragOperationMask:operationMask]); | 477 dragOperationMask:operationMask]); |
| 478 [dragSource_ startDrag]; | 478 [dragSource_ startDrag]; |
| 479 } | 479 } |
| 480 | 480 |
| 481 // NSDraggingSource methods | 481 // NSDraggingSource methods |
| 482 | 482 |
| 483 // Returns what kind of drag operations are available. This is a required | 483 // Returns what kind of drag operations are available. This is a required |
| 484 // method for NSDraggingSource. | 484 // method for NSDraggingSource. |
| 485 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { | 485 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { |
| 486 if (dragSource_.get()) | 486 if (dragSource_) |
| 487 return [dragSource_ draggingSourceOperationMaskForLocal:isLocal]; | 487 return [dragSource_ draggingSourceOperationMaskForLocal:isLocal]; |
| 488 // No web drag source - this is the case for dragging a file from the | 488 // No web drag source - this is the case for dragging a file from the |
| 489 // downloads manager. Default to copy operation. Note: It is desirable to | 489 // downloads manager. Default to copy operation. Note: It is desirable to |
| 490 // allow the user to either move or copy, but this requires additional | 490 // allow the user to either move or copy, but this requires additional |
| 491 // plumbing to update the download item's path once its moved. | 491 // plumbing to update the download item's path once its moved. |
| 492 return NSDragOperationCopy; | 492 return NSDragOperationCopy; |
| 493 } | 493 } |
| 494 | 494 |
| 495 // Called when a drag initiated in our view ends. | 495 // Called when a drag initiated in our view ends. |
| 496 - (void)draggedImage:(NSImage*)anImage | 496 - (void)draggedImage:(NSImage*)anImage |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 [[[notification userInfo] objectForKey:kSelectionDirection] | 562 [[[notification userInfo] objectForKey:kSelectionDirection] |
| 563 unsignedIntegerValue]; | 563 unsignedIntegerValue]; |
| 564 if (direction == NSDirectSelection) | 564 if (direction == NSDirectSelection) |
| 565 return; | 565 return; |
| 566 | 566 |
| 567 [self webContents]-> | 567 [self webContents]-> |
| 568 FocusThroughTabTraversal(direction == NSSelectingPrevious); | 568 FocusThroughTabTraversal(direction == NSSelectingPrevious); |
| 569 } | 569 } |
| 570 | 570 |
| 571 @end | 571 @end |
| OLD | NEW |