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

Unified Diff: chrome/browser/cocoa/tab_strip_view.mm

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/tab_strip_view.mm
diff --git a/chrome/browser/cocoa/tab_strip_view.mm b/chrome/browser/cocoa/tab_strip_view.mm
index f2638dce6b7bf9886e3769a4007a3b55f91abe3c..1dcd7469133e8fb49dfa690bed5532d4c76cf30c 100644
--- a/chrome/browser/cocoa/tab_strip_view.mm
+++ b/chrome/browser/cocoa/tab_strip_view.mm
@@ -16,6 +16,9 @@
// Set lastMouseUp_ = -1000.0 so that timestamp-lastMouseUp_ is big unless
// lastMouseUp_ has been reset.
lastMouseUp_ = -1000.0;
+
+ // Register to be an URL drop target.
+ dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]);
}
return self;
}
@@ -72,4 +75,24 @@
lastMouseUp_ = (clickCount == 1) ? timestamp : -1000.0;
}
+// Required by |URLDropTargetHandler|.
+- (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender {
+ return [dropHandler_ draggingEntered:sender];
+}
+
+// Required by |URLDropTargetHandler|.
+- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender {
+ return [dropHandler_ draggingUpdated:sender];
+}
+
+// Required by |URLDropTargetHandler|.
+- (void)draggingExited:(id<NSDraggingInfo>)sender {
+ return [dropHandler_ draggingExited:sender];
+}
+
+// Required by |URLDropTargetHandler|.
+- (BOOL)performDragOperation:(id<NSDraggingInfo>)sender {
+ return [dropHandler_ performDragOperation:sender];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698