From d8fed64f1099df4229243f8f811aaf1c8a0144c3 Mon Sep 17 00:00:00 2001 From: "beng@google.com" Date: Sat, 9 Aug 2008 21:23:21 +0000 Subject: Make sure the TabStrip is laid out after a drag-detach operation is completed. This is important because if there was a pending animation it was canceled, potentially leaving the TabStrip in a bad visual state. Also remove some debugging code that wasn't useful. B=1317895 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@633 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tabs/dragged_tab_controller.cc | 4 ---- chrome/browser/tabs/tab_strip.cc | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/browser/tabs') diff --git a/chrome/browser/tabs/dragged_tab_controller.cc b/chrome/browser/tabs/dragged_tab_controller.cc index 0e7ac34..c522276 100644 --- a/chrome/browser/tabs/dragged_tab_controller.cc +++ b/chrome/browser/tabs/dragged_tab_controller.cc @@ -727,10 +727,6 @@ bool DraggedTabController::CompleteDrag() { destroy_immediately = false; } else { // Compel the model to construct a new window for the detached TabContents. - // TODO(beng): this is here for one cycle only to see if it's - // dragged_contents_ that's getting freed, or something else. - dragged_contents_->GetContentHWND(); - dragged_contents_->GetTitle().size(); source_tabstrip_->model()->TearOffTabContents( dragged_contents_, GetWindowCreatePoint()); diff --git a/chrome/browser/tabs/tab_strip.cc b/chrome/browser/tabs/tab_strip.cc index 04b33b3..2354f5e 100644 --- a/chrome/browser/tabs/tab_strip.cc +++ b/chrome/browser/tabs/tab_strip.cc @@ -546,6 +546,10 @@ void TabStrip::DestroyDraggedSourceTab(Tab* tab) { } tab->GetParent()->RemoveChildView(tab); delete tab; + // Force a layout here, because if we've just quickly drag detached a Tab, + // the stopping of the active animation above may have left the TabStrip in a + // bad (visual) state. + Layout(); } gfx::Rect TabStrip::GetIdealBounds(int index) { -- cgit v1.1