diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 07:05:22 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-13 07:05:22 +0000 |
commit | 1ad29e21b21982e80b666535d2329ca8baa20278 (patch) | |
tree | 9652cb974b6a203d95d4c277ebf08db7a83fb727 /chrome/browser/views/tabs | |
parent | 402cb88c926994d0fb35a9dbf71808117d8d0118 (diff) | |
download | chromium_src-1ad29e21b21982e80b666535d2329ca8baa20278.zip chromium_src-1ad29e21b21982e80b666535d2329ca8baa20278.tar.gz chromium_src-1ad29e21b21982e80b666535d2329ca8baa20278.tar.bz2 |
Some speculative fixes for UI test flakiness.
- make the window update locking use window visibility instead of WM_SETREDRAW. I believe WM_SETREDRAW is causing the window to become visible during tests.
- potential crashes caused by NULL TabcontentsDelegates.
TBR=sky
Review URL: http://codereview.chromium.org/10674
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index 38ab339..df1cd2b 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -108,6 +108,9 @@ DraggedTabController::~DraggedTabController() { // bounds, it won't be able to clean up properly since its cleanup routine // uses GetIndexForDraggedContents, which will be invalid. view_.reset(NULL); + // Make sure the TabContents doesn't think we're still its delegate. + if (dragged_contents_ && dragged_contents_->delegate() == this) + dragged_contents_->set_delegate(NULL); ChangeDraggedContents(NULL); // This removes our observer. } @@ -290,17 +293,15 @@ gfx::Point DraggedTabController::GetWindowCreatePoint() const { void DraggedTabController::ChangeDraggedContents(TabContents* new_contents) { if (dragged_contents_) { - dragged_contents_->set_delegate(NULL); NotificationService::current()->RemoveObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, - Source<TabContents>(dragged_contents_)); + NOTIFY_TAB_CONTENTS_DESTROYED, + Source<TabContents>(dragged_contents_)); } dragged_contents_ = new_contents; if (dragged_contents_) { - dragged_contents_->set_delegate(this); NotificationService::current()->AddObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, - Source<TabContents>(dragged_contents_)); + NOTIFY_TAB_CONTENTS_DESTROYED, + Source<TabContents>(dragged_contents_)); } } |