Index: chrome/browser/ui/cocoa/web_drag_source.mm |
diff --git a/chrome/browser/ui/cocoa/web_drag_source.mm b/chrome/browser/ui/cocoa/web_drag_source.mm |
index 24c121acf23194de85e3a8e6659744a91ea04866..2868cff9f59f5586cad0901943a7759395ac150d 100644 |
--- a/chrome/browser/ui/cocoa/web_drag_source.mm |
+++ b/chrome/browser/ui/cocoa/web_drag_source.mm |
@@ -257,7 +257,9 @@ void PromiseWriterTask::Run() { |
rvh->DragSourceSystemDragEnded(); |
// Convert |screenPoint| to view coordinates and flip it. |
- NSPoint localPoint = [self convertScreenPoint:screenPoint]; |
+ NSPoint localPoint = NSMakePoint(0, 0); |
+ if ([contentsView_ window]) |
+ localPoint = [self convertScreenPoint:screenPoint]; |
NSRect viewFrame = [contentsView_ frame]; |
localPoint.y = viewFrame.size.height - localPoint.y; |
// Flip |screenPoint|. |
@@ -277,7 +279,9 @@ void PromiseWriterTask::Run() { |
RenderViewHost* rvh = [contentsView_ tabContents]->render_view_host(); |
if (rvh) { |
// Convert |screenPoint| to view coordinates and flip it. |
- NSPoint localPoint = [self convertScreenPoint:screenPoint]; |
+ NSPoint localPoint = NSMakePoint(0, 0); |
+ if ([contentsView_ window]) |
+ localPoint = [self convertScreenPoint:screenPoint]; |
NSRect viewFrame = [contentsView_ frame]; |
localPoint.y = viewFrame.size.height - localPoint.y; |
// Flip |screenPoint|. |