diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 19:32:00 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 19:32:00 +0000 |
commit | 4d68ca4dd7010a206ee3481ad7dd62dd84806aa2 (patch) | |
tree | b0817cd5c4edf226980fb54682e39c8b5e54c8a0 /chrome/browser | |
parent | f3f9106c281f61e7ce7e343e7cea47ae112dff8e (diff) | |
download | chromium_src-4d68ca4dd7010a206ee3481ad7dd62dd84806aa2.zip chromium_src-4d68ca4dd7010a206ee3481ad7dd62dd84806aa2.tar.gz chromium_src-4d68ca4dd7010a206ee3481ad7dd62dd84806aa2.tar.bz2 |
Fix a couple of tab related bugs:
- moving the window while a tab is animating to its final resting position disembodies the tab
- it's possible to make a tab disappear while clicking on another tab while a tab is animating to its final resting position
http://crbug.com/2388
http://crbug.com/1142
Review URL: http://codereview.chromium.org/8689
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4155 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index e1fab37..af660d4 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -944,6 +944,10 @@ StatusBubble* Browser::GetStatusBubble() { // of any WS_POPUP HWNDs. void Browser::WindowMoved() { DCHECK(!g_browser_process->IsUsingNewFrames()); + // Cancel any tabstrip animations, some of them may be invalidated by the + // window being repositioned. + window_->GetTabStrip()->DestroyDragController(); + GetStatusBubble()->Reposition(); // Close the omnibox popup, if any. diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index cadf038..dcc9769 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -114,6 +114,10 @@ BrowserView2::~BrowserView2() { } void BrowserView2::WindowMoved() { + // Cancel any tabstrip animations, some of them may be invalidated by the + // window being repositioned. + tabstrip_->DestroyDragController(); + status_bubble_->Reposition(); // Close the omnibox popup, if any. diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index cf768a7..455c703 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -103,6 +103,11 @@ DraggedTabController::~DraggedTabController() { in_destructor_ = true; CleanUpSourceTab(); MessageLoopForUI::current()->RemoveObserver(this); + // Need to delete the view here manually _before_ we reset the dragged + // contents to NULL, otherwise if the view is animating to its destination + // bounds, it won't be able to clean up properly since its cleanup routine + // uses GetIndexForDraggedContents, which will be invalid. + view_.reset(NULL); ChangeDraggedContents(NULL); // This removes our observer. } |