diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 13:58:22 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 13:58:22 +0000 |
commit | cf06d35adf3115c1bc43021840d141f47d7c0cec (patch) | |
tree | 6b3953fac42ccc144163e7969de6a12bd5bdf08c /chrome/browser/cocoa/tab_window_controller.mm | |
parent | e676c7464e4b1e70e85464db8803702a66976bf0 (diff) | |
download | chromium_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_window_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/tab_window_controller.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_window_controller.mm b/chrome/browser/cocoa/tab_window_controller.mm index 5e9ce23..e405887 100644 --- a/chrome/browser/cocoa/tab_window_controller.mm +++ b/chrome/browser/cocoa/tab_window_controller.mm @@ -42,8 +42,11 @@ - (void)removeOverlay { [self setUseOverlay:NO]; + if (closeDeferred_) + [[self window] performClose:self]; // Autoreleases the controller. } +// TODO(pinkerton): Nobody calls this, can we remove it? - (void)removeOverlayAfterDelay:(NSTimeInterval)delay { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(removeOverlay) @@ -199,4 +202,11 @@ [lockedTabs_ addObject:tabView]; } +// Tell the window that it needs to call performClose: as soon as the current +// drag is complete. This prevents a window (and its overlay) from going away +// during a drag. +- (void)deferPerformClose { + closeDeferred_ = YES; +} + @end |