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

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

Issue 501135: Revert 34998, more stabbing in the dark to find a perf regression - Mac: impl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- chrome/browser/cocoa/url_drop_target.mm (revision 35037)
+++ chrome/browser/cocoa/url_drop_target.mm (working copy)
@@ -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)
« 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