Chromium Code Reviews| 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..a0e806e598bf91f8ec655f279b204026facf17f3 100644 |
| --- a/chrome/browser/ui/cocoa/web_drag_source.mm |
| +++ b/chrome/browser/ui/cocoa/web_drag_source.mm |
| @@ -4,6 +4,8 @@ |
| #import "chrome/browser/ui/cocoa/web_drag_source.h" |
| +#include <limits> |
|
jianli
2011/01/12 21:32:27
Why is this include needed in this patch?
gmorrita
2011/01/13 08:34:43
Oops. removed.
|
| + |
| #include "app/mac/nsimage_cache.h" |
| #include "base/file_path.h" |
| #include "base/string_util.h" |
| @@ -253,7 +255,7 @@ void PromiseWriterTask::Run() { |
| - (void)endDragAt:(NSPoint)screenPoint |
| operation:(NSDragOperation)operation { |
| RenderViewHost* rvh = [contentsView_ tabContents]->render_view_host(); |
| - if (rvh) { |
| + if (rvh && [contentsView_ window]) { |
|
jianli
2011/01/12 21:32:27
It might be better to check [contentsView_ window]
|
| rvh->DragSourceSystemDragEnded(); |
| // Convert |screenPoint| to view coordinates and flip it. |
| @@ -275,7 +277,7 @@ void PromiseWriterTask::Run() { |
| - (void)moveDragTo:(NSPoint)screenPoint { |
| RenderViewHost* rvh = [contentsView_ tabContents]->render_view_host(); |
| - if (rvh) { |
| + if (rvh && [contentsView_ window]) { |
|
jianli
2011/01/12 21:32:27
ditto.
|
| // Convert |screenPoint| to view coordinates and flip it. |
| NSPoint localPoint = [self convertScreenPoint:screenPoint]; |
| NSRect viewFrame = [contentsView_ frame]; |