summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm10
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index ac78712..fc1e0ec 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -270,6 +270,12 @@
gfx::Rect browserRect(windowRect.origin.x, windowRect.origin.y,
windowRect.size.width, windowRect.size.height);
+ // Detach it from the source window, which just updates the model without
+ // deleting the tab contents. This needs to come before creating the new
+ // Browser because it clears the TabContents' delegate, which gets hooked
+ // up during creation of the new window.
+ browser_->tabstrip_model()->DetachTabContentsAt(index);
+
// Create the new window with a single tab in its model, the one being
// dragged.
DockInfo dockInfo;
@@ -283,10 +289,6 @@
[newBrowser->window()->GetNativeHandle() delegate];
DCHECK(controller && [controller isKindOfClass:[TabWindowController class]]);
- // Detach it from the source window, which just updates the model without
- // deleting the tab contents.
- browser_->tabstrip_model()->DetachTabContentsAt(index);
-
return controller;
}