| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_ |
| 6 #define CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 @interface URLDropTargetHandler : NSObject { |
| 11 @private |
| 12 NSView* view_; // weak |
| 13 } |
| 14 |
| 15 // Initialize the given view to accept drops of URLs; this requires the view's |
| 16 // window's controller to implement the |URLDropTargetWindowController| protocol |
| 17 // (below). |
| 18 - (id)initWithView:(NSView*)view; |
| 19 |
| 20 // The owner view should implement the following methods by calling the |
| 21 // |URLDropTargetHandler|'s version, and leave the others to the default |
| 22 // implementation provided by |NSView|/|NSWindow|. |
| 23 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender; |
| 24 - (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender; |
| 25 - (void)draggingExited:(id<NSDraggingInfo>)sender; |
| 26 - (BOOL)performDragOperation:(id<NSDraggingInfo>)sender; |
| 27 |
| 28 @end // @interface URLDropTargetHandler |
| 29 |
| 30 @protocol URLDropTargetWindowController |
| 31 |
| 32 // The given URLs (an |NSArray| of |NSString|s) were dropped at the given |
| 33 // location (location in window base coordinates). |
| 34 - (void)dropURLs:(NSArray*)urls at:(NSPoint)location; |
| 35 |
| 36 // Dragging is in progress over the owner view (at the given location, in window |
| 37 // base coordinates) and any indicator of location -- e.g., an arrow -- should |
| 38 // be updated/shown. |
| 39 - (void)indicateDropURLsAt:(NSPoint)location; |
| 40 |
| 41 // Dragging is over, and any indicator should be hidden. |
| 42 - (void)hideDropURLsIndicator; |
| 43 |
| 44 @end // @protocol URLDropTargetWindowController |
| 45 |
| 46 #endif // CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_ |
| OLD | NEW |