Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1894)

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 306006: Make dropped tabs animate from where they were dropped. Make room for the ful... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 29397)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -718,15 +718,28 @@
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];
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698