summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 17:40:24 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 17:40:24 +0000
commitf73bae9079d1d06b07eadaf86a2b4d7338fc78f9 (patch)
treed7585ac207e13d73e6dec5d6d49b219f5e9c3eea /chrome/browser/cocoa/browser_window_controller.mm
parent4f16943f6e3debd2456e62770deb9062b1ae0d6e (diff)
downloadchromium_src-f73bae9079d1d06b07eadaf86a2b4d7338fc78f9.zip
chromium_src-f73bae9079d1d06b07eadaf86a2b4d7338fc78f9.tar.gz
chromium_src-f73bae9079d1d06b07eadaf86a2b4d7338fc78f9.tar.bz2
Make dropped tabs animate from where they were dropped. Make room for the full width of the tab placeholder. Make tab dragging as smooth as glass.
BUG=24982, 24983 TEST=tab dragging between windows, tab dragging w/in a window. Review URL: http://codereview.chromium.org/306006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm17
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index d75b41e..1fa62b1 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -704,15 +704,28 @@ willPositionSheet:(NSWindow*)sheet
if (!contents)
return;
+ // Convert |view|'s frame (which starts in the source tab strip's coordinate
+ // system) to the coordinate system of the destination tab strip. This needs
+ // to be done before being detached so the window transforms can be
+ // performed.
+ NSRect destinationFrame = [view frame];
+ NSPoint tabOrigin = destinationFrame.origin;
+ tabOrigin = [[dragController tabStripView] convertPoint:tabOrigin
+ toView:nil];
+ tabOrigin = [[view window] convertBaseToScreen:tabOrigin];
+ tabOrigin = [[self window] convertScreenToBase:tabOrigin];
+ tabOrigin = [[self tabStripView] convertPoint:tabOrigin fromView:nil];
+ destinationFrame.origin = tabOrigin;
+
// Now that we have enough information about the tab, we can remove it from
// the dragging window. We need to do this *before* we add it to the new
- // window as this will removes the TabContents' delegate.
+ // window as this will remove the TabContents' delegate.
[dragController detachTabView:view];
// Deposit it into our model at the appropriate location (it already knows
// where it should go from tracking the drag). Doing this sets the tab's
// delegate to be the Browser.
- [tabStripController_ dropTabContents:contents];
+ [tabStripController_ dropTabContents:contents withFrame:destinationFrame];
} else {
// Moving within a window.
int index = [tabStripController_ indexForTabView:view];