summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.h6
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm10
2 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.h b/chrome/browser/cocoa/browser_window_controller.h
index 04deaf58..df77819 100644
--- a/chrome/browser/cocoa/browser_window_controller.h
+++ b/chrome/browser/cocoa/browser_window_controller.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_BROWSER_WINDOW_CONTROLLER_H_
-#define CHROME_BROWSER_BROWSER_WINDOW_CONTROLLER_H_
+#ifndef CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
+#define CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
// A class acting as the Objective-C controller for the Browser object. Handles
// interactions between Cocoa and the cross-platform code.
@@ -77,4 +77,4 @@ class TabStripModelObserverBridge;
@end
-#endif // CHROME_BROWSER_BROWSER_WINDOW_CONTROLLER_H_
+#endif // CHROME_BROWSER_COCOA_BROWSER_WINDOW_CONTROLLER_H_
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;
}