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

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

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/url_drop_target.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/url_drop_target.mm
diff --git a/chrome/browser/cocoa/url_drop_target.mm b/chrome/browser/cocoa/url_drop_target.mm
index 6a2031d073e601e4a2e5ce68cabf1209e6dad4ab..d21cd67ec3d2a3e4d0070e7af513d6e63f75d17c 100644
--- a/chrome/browser/cocoa/url_drop_target.mm
+++ b/chrome/browser/cocoa/url_drop_target.mm
@@ -9,9 +9,6 @@
@interface URLDropTargetHandler(Private)
-// Get the window controller.
-- (id<URLDropTargetWindowController>)windowController;
-
// Gets the appropriate drag operation given the |NSDraggingInfo|.
- (NSDragOperation)getDragOperation:(id<NSDraggingInfo>)sender;
@@ -47,7 +44,8 @@
NSDragOperation dragOp = [self getDragOperation:sender];
if (dragOp == NSDragOperationCopy) {
// Just tell the window controller to update the indicator.
- [[self windowController] indicateDropURLsAt:[sender draggingLocation]];
+ NSPoint hoverPoint = [view_ convertPointFromBase:[sender draggingLocation]];
+ [[view_ urlDropController] indicateDropURLsInView:view_ at:hoverPoint];
}
return dragOp;
}
@@ -67,7 +65,9 @@
if ([urls count]) {
// Tell the window controller about the dropped URL(s).
- [[self windowController] dropURLs:urls at:[sender draggingLocation]];
+ NSPoint dropPoint =
+ [view_ convertPointFromBase:[sender draggingLocation]];
+ [[view_ urlDropController] dropURLs:urls inView:view_ at:dropPoint];
return YES;
}
}
@@ -79,21 +79,13 @@
@implementation URLDropTargetHandler(Private)
-- (id<URLDropTargetWindowController>)windowController {
- id<URLDropTargetWindowController> controller =
- [[view_ window] windowController];
- DCHECK([(id)controller conformsToProtocol:
- @protocol(URLDropTargetWindowController)]);
- return controller;
-}
-
- (NSDragOperation)getDragOperation:(id<NSDraggingInfo>)sender {
// Only allow the copy operation.
return [sender draggingSourceOperationMask] & NSDragOperationCopy;
}
- (void)hideIndicator {
- [[self windowController] hideDropURLsIndicator];
+ [[view_ urlDropController] hideDropURLsIndicatorInView:view_];
}
@end // @implementation URLDropTargetHandler(Private)
« no previous file with comments | « chrome/browser/cocoa/url_drop_target.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698