summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/tabs')
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index 4da9dba..38ab339 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -172,8 +172,6 @@ void DraggedTabController::NavigationStateChanged(const TabContents* source,
void DraggedTabController::ReplaceContents(TabContents* source,
TabContents* new_contents) {
DCHECK(dragged_contents_ == source);
- source->set_delegate(NULL);
- new_contents->set_delegate(this);
// If we're attached to a TabStrip, we need to tell the TabStrip that this
// TabContents was replaced.
@@ -292,12 +290,14 @@ 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_));
}
dragged_contents_ = new_contents;
if (dragged_contents_) {
+ dragged_contents_->set_delegate(this);
NotificationService::current()->AddObserver(this,
NOTIFY_TAB_CONTENTS_DESTROYED,
Source<TabContents>(dragged_contents_));
@@ -642,14 +642,6 @@ void DraggedTabController::EndDragImpl(EndDragType type) {
destroy_now = CompleteDrag();
}
}
- } else {
- // If we get here it means the NavigationController is going down. Don't
- // attempt to do any cleanup other than resetting the delegate (if we're
- // still the delegate).
- if (dragged_contents_ && dragged_contents_->delegate() == this)
- dragged_contents_->set_delegate(NULL);
- dragged_contents_ = NULL;
- attached_tabstrip_ = NULL;
}
// If we're not destroyed now, we'll be destroyed asynchronously later.
if (destroy_now)