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

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

Issue 337055: Mac: implement drag-and-drop of URLs to tabs/tab strip. (Closed)
Patch Set: Give another line back. 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
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
new file mode 100644
index 0000000000000000000000000000000000000000..2745cefc5e6776be2689570956bd40b666853ea0
--- /dev/null
+++ b/chrome/browser/cocoa/url_drop_target.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_
+#define CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_
+
+#import <Cocoa/Cocoa.h>
+
+@interface URLDropTargetHandler : NSObject {
+ @private
+ NSView* 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;
+
+// The owner view should implement the following methods by calling the
+// |URLDropTargetHandler|'s version, and leave the others to the default
+// implementation provided by |NSView|/|NSWindow|.
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender;
+- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender;
+- (void)draggingExited:(id<NSDraggingInfo>)sender;
+- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender;
+
+@end // @interface URLDropTargetHandler
+
+@protocol URLDropTargetWindowController
+
+// 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;
+
+// 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 over, and any indicator should be hidden.
+- (void)hideDropURLsIndicator;
+
+@end // @protocol URLDropTargetWindowController
+
+#endif // CHROME_BROWSER_COCOA_URL_DROP_TARGET_H_

Powered by Google App Engine
This is Rietveld 408576698