summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 20:49:26 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-09 20:49:26 +0000
commit3409a076f506e4d7e80f7d79424ca27741ceeb19 (patch)
tree2a2a3a17b522d7cbbcb5499ea7493e121c31451e /chrome/browser/cocoa
parent69444cc086ef3ddf9aaecb4d6bebcb24687c6977 (diff)
downloadchromium_src-3409a076f506e4d7e80f7d79424ca27741ceeb19.zip
chromium_src-3409a076f506e4d7e80f7d79424ca27741ceeb19.tar.gz
chromium_src-3409a076f506e4d7e80f7d79424ca27741ceeb19.tar.bz2
Re-order the steps used to create the new browser window on a tab drag in order to make sure the TabContents' delegate doesn't get clobbered. Fix the define of a file that had been moved a while ago.
Review URL: http://codereview.chromium.org/67007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13455 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-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;
}