diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 06:11:06 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 06:11:06 +0000 |
commit | 6ce66267c8511a13c7f7d7a12bae558859d71d93 (patch) | |
tree | e42000bf1731158a545229377c8d0c994e9a6181 /chrome/browser/cocoa/url_drop_target.mm | |
parent | 3740cb9b54f6a5d28c3501b650b7c179101568eb (diff) | |
download | chromium_src-6ce66267c8511a13c7f7d7a12bae558859d71d93.zip chromium_src-6ce66267c8511a13c7f7d7a12bae558859d71d93.tar.gz chromium_src-6ce66267c8511a13c7f7d7a12bae558859d71d93.tar.bz2 |
Half of CL 481012 (reverted at r35038).
CL 481012 was: Mac: implement DnD of URLs onto Omnibox.
This is the half consisting of mild refactoring and no new functionality.
BUG=none
TEST=Dragging and dropping URLs onto the tab strip should still work as before. More important is whether this regresses the startup tests.
TBR=shess@chromium.org
Review URL: http://codereview.chromium.org/505057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/url_drop_target.mm')
-rw-r--r-- | chrome/browser/cocoa/url_drop_target.mm | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/chrome/browser/cocoa/url_drop_target.mm b/chrome/browser/cocoa/url_drop_target.mm index 6a2031d..d21cd67 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) |