diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 03:30:19 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-19 03:30:19 +0000 |
commit | 0ec9512a65f8d7f15dbddd902363994660d85ffb (patch) | |
tree | a075476ee0051162b69ab79308080a1c8ca8c985 /chrome/browser/cocoa/url_drop_target.mm | |
parent | 732169bb11fbca6eb6048e37f1d897880771115b (diff) | |
download | chromium_src-0ec9512a65f8d7f15dbddd902363994660d85ffb.zip chromium_src-0ec9512a65f8d7f15dbddd902363994660d85ffb.tar.gz chromium_src-0ec9512a65f8d7f15dbddd902363994660d85ffb.tar.bz2 |
Revert 34998, more stabbing in the dark to find a perf regression - Mac: implement DnD of URLs onto Omnibox.
(DnD of text coming in another patch.)
BUG=24631
TEST=Select a URL/link/file from somewhere (a link in a browser, a URL in text, a file from the desktop, etc.) and drag it to the Omnibox in a Chromium browser window; the contents of the Omnibox should be selected to indicate that a drop would replace its contents; dropping should navigate to the appropriate location.
Review URL: http://codereview.chromium.org/481012
TBR=viettrungluu@chromium.org
Review URL: http://codereview.chromium.org/501135
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35038 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, 14 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/url_drop_target.mm b/chrome/browser/cocoa/url_drop_target.mm index d21cd67..6a2031d 100644 --- a/chrome/browser/cocoa/url_drop_target.mm +++ b/chrome/browser/cocoa/url_drop_target.mm @@ -9,6 +9,9 @@ @interface URLDropTargetHandler(Private) +// Get the window controller. +- (id<URLDropTargetWindowController>)windowController; + // Gets the appropriate drag operation given the |NSDraggingInfo|. - (NSDragOperation)getDragOperation:(id<NSDraggingInfo>)sender; @@ -44,8 +47,7 @@ NSDragOperation dragOp = [self getDragOperation:sender]; if (dragOp == NSDragOperationCopy) { // Just tell the window controller to update the indicator. - NSPoint hoverPoint = [view_ convertPointFromBase:[sender draggingLocation]]; - [[view_ urlDropController] indicateDropURLsInView:view_ at:hoverPoint]; + [[self windowController] indicateDropURLsAt:[sender draggingLocation]]; } return dragOp; } @@ -65,9 +67,7 @@ if ([urls count]) { // Tell the window controller about the dropped URL(s). - NSPoint dropPoint = - [view_ convertPointFromBase:[sender draggingLocation]]; - [[view_ urlDropController] dropURLs:urls inView:view_ at:dropPoint]; + [[self windowController] dropURLs:urls at:[sender draggingLocation]]; return YES; } } @@ -79,13 +79,21 @@ @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 { - [[view_ urlDropController] hideDropURLsIndicatorInView:view_]; + [[self windowController] hideDropURLsIndicator]; } @end // @implementation URLDropTargetHandler(Private) |