summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_view.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 13:58:22 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-30 13:58:22 +0000
commitcf06d35adf3115c1bc43021840d141f47d7c0cec (patch)
tree6b3953fac42ccc144163e7969de6a12bd5bdf08c /chrome/browser/cocoa/tab_view.mm
parente676c7464e4b1e70e85464db8803702a66976bf0 (diff)
downloadchromium_src-cf06d35adf3115c1bc43021840d141f47d7c0cec.zip
chromium_src-cf06d35adf3115c1bc43021840d141f47d7c0cec.tar.gz
chromium_src-cf06d35adf3115c1bc43021840d141f47d7c0cec.tar.bz2
Fix a bug where dragging a window that's been closed by JS back into another window would crash. Be more specific about when the window will be closed/deleted during dragging in hopes of making future crashes a little more clear.
BUG=none TEST=dragging tabs between windows should work. tabs closed via window.close() on a timer should work. Review URL: http://codereview.chromium.org/246035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27606 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_view.mm')
-rw-r--r--chrome/browser/cocoa/tab_view.mm12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/tab_view.mm b/chrome/browser/cocoa/tab_view.mm
index 6e741da..f44a482 100644
--- a/chrome/browser/cocoa/tab_view.mm
+++ b/chrome/browser/cocoa/tab_view.mm
@@ -491,12 +491,14 @@ static const CGFloat kRapidCloseDist = 2.5;
[targetController_ showWindow:nil];
} else {
// Tab dragging did move window only.
- [dragWindow_ setAlphaValue:1.0];
- [dragOverlay_ setHasShadow:NO];
- [dragWindow_ setHasShadow:YES];
[draggedController_ removeOverlay];
- [dragWindow_ makeKeyAndOrderFront:nil];
-
+ // Don't want to re-show the window if it was closed during the drag.
+ if ([dragWindow_ isVisible]) {
+ [dragWindow_ setAlphaValue:1.0];
+ [dragOverlay_ setHasShadow:NO];
+ [dragWindow_ setHasShadow:YES];
+ [dragWindow_ makeKeyAndOrderFront:nil];
+ }
[[draggedController_ window] setLevel:NSNormalWindowLevel];
[draggedController_ removePlaceholder];
}