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

Unified Diff: chrome/browser/cocoa/url_drop_target.h

Issue 481012: Mac: implement DnD of URLs onto Omnibox. (Closed)
Patch Set: Stuff. Created 11 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.mm ('k') | chrome/browser/cocoa/url_drop_target.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/url_drop_target.h
diff --git a/chrome/browser/cocoa/url_drop_target.h b/chrome/browser/cocoa/url_drop_target.h
index 2745cefc5e6776be2689570956bd40b666853ea0..6b941133ea5d9e470c841cb8f416a535ae4ddc94 100644
--- a/chrome/browser/cocoa/url_drop_target.h
+++ b/chrome/browser/cocoa/url_drop_target.h
@@ -7,15 +7,19 @@
#import <Cocoa/Cocoa.h>
+@protocol URLDropTarget;
+@protocol URLDropTargetController;
+
+// Object which coordinates the dropping of URLs on a given view, sending data
+// and updates to a controller.
@interface URLDropTargetHandler : NSObject {
@private
- NSView* view_; // weak
+ NSView<URLDropTarget>* view_; // weak
}
-// Initialize the given view to accept drops of URLs; this requires the view's
-// window's controller to implement the |URLDropTargetWindowController| protocol
-// (below).
-- (id)initWithView:(NSView*)view;
+// Initialize the given view, which must implement the |URLDropTarget| (below),
+// to accept drops of URLs.
+- (id)initWithView:(NSView<URLDropTarget>*)view;
// The owner view should implement the following methods by calling the
// |URLDropTargetHandler|'s version, and leave the others to the default
@@ -27,20 +31,37 @@
@end // @interface URLDropTargetHandler
-@protocol URLDropTargetWindowController
+// Protocol which views that are URL drop targets and use |URLDropTargetHandler|
+// must implement.
+@protocol URLDropTarget
+
+// Returns the controller which handles the drop.
+- (id<URLDropTargetController>)urlDropController;
+
+// The following, which come from |NSDraggingDestination|, must be implemented
+// by calling the |URLDropTargetHandler|'s implementations.
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender;
+- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender;
+- (void)draggingExited:(id<NSDraggingInfo>)sender;
+- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender;
+
+@end // @protocol URLDropTarget
+
+// Protocol for the controller which handles the actual drop data/drop updates.
+@protocol URLDropTargetController
-// The given URLs (an |NSArray| of |NSString|s) were dropped at the given
-// location (location in window base coordinates).
-- (void)dropURLs:(NSArray*)urls at:(NSPoint)location;
+// The given URLs (an |NSArray| of |NSString|s) were dropped in the given view
+// at the given point (in that view's coordinates).
+- (void)dropURLs:(NSArray*)urls inView:(NSView*)view at:(NSPoint)point;
-// Dragging is in progress over the owner view (at the given location, in window
-// base coordinates) and any indicator of location -- e.g., an arrow -- should
-// be updated/shown.
-- (void)indicateDropURLsAt:(NSPoint)location;
+// Dragging is in progress over the owner view (at the given point, in view
+// coordinates) and any indicator of location -- e.g., an arrow -- should be
+// updated/shown.
+- (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point;
// Dragging is over, and any indicator should be hidden.
-- (void)hideDropURLsIndicator;
+- (void)hideDropURLsIndicatorInView:(NSView*)view;
-@end // @protocol URLDropTargetWindowController
+@end // @protocol URLDropTargetController
#endif // CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.mm ('k') | chrome/browser/cocoa/url_drop_target.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698