| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 dropData:&dropData | 518 dropData:&dropData |
| 519 image:image | 519 image:image |
| 520 offset:offset | 520 offset:offset |
| 521 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] | 521 pasteboard:[NSPasteboard pasteboardWithName:NSDragPboard] |
| 522 dragOperationMask:operationMask]); | 522 dragOperationMask:operationMask]); |
| 523 [dragSource_ startDrag]; | 523 [dragSource_ startDrag]; |
| 524 } | 524 } |
| 525 | 525 |
| 526 // NSDraggingSource methods | 526 // NSDraggingSource methods |
| 527 | 527 |
| 528 // Returns what kind of drag operations are available. This is a required | |
| 529 // method for NSDraggingSource. | |
| 530 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { | 528 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { |
| 531 if (dragSource_) | 529 if (dragSource_) |
| 532 return [dragSource_ draggingSourceOperationMaskForLocal:isLocal]; | 530 return [dragSource_ draggingSourceOperationMaskForLocal:isLocal]; |
| 533 // No web drag source - this is the case for dragging a file from the | 531 // No web drag source - this is the case for dragging a file from the |
| 534 // downloads manager. Default to copy operation. Note: It is desirable to | 532 // downloads manager. Default to copy operation. Note: It is desirable to |
| 535 // allow the user to either move or copy, but this requires additional | 533 // allow the user to either move or copy, but this requires additional |
| 536 // plumbing to update the download item's path once its moved. | 534 // plumbing to update the download item's path once its moved. |
| 537 return NSDragOperationCopy; | 535 return NSDragOperationCopy; |
| 538 } | 536 } |
| 539 | 537 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 | 679 |
| 682 - (void)viewDidHide { | 680 - (void)viewDidHide { |
| 683 [self updateWebContentsVisibility]; | 681 [self updateWebContentsVisibility]; |
| 684 } | 682 } |
| 685 | 683 |
| 686 - (void)viewDidUnhide { | 684 - (void)viewDidUnhide { |
| 687 [self updateWebContentsVisibility]; | 685 [self updateWebContentsVisibility]; |
| 688 } | 686 } |
| 689 | 687 |
| 690 @end | 688 @end |
| OLD | NEW |