summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-18 21:31:32 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-18 21:31:32 +0000
commitfe92e4e260604d627ca0aa79b4b2d619ee42183d (patch)
treed2e4ca51db9ff1a930570771aea5550c1e566ef6 /chrome/browser/views
parentd055d8e56a5704b9e3104f5aa527d103815a093a (diff)
downloadchromium_src-fe92e4e260604d627ca0aa79b4b2d619ee42183d.zip
chromium_src-fe92e4e260604d627ca0aa79b4b2d619ee42183d.tar.gz
chromium_src-fe92e4e260604d627ca0aa79b4b2d619ee42183d.tar.bz2
Roll back a bunch of changes to tab dragging that seem to not have helped reduce the crashiness any :-/
r5335 dragged_tab_controller.cc (delegate NULL setting) r5124 changes to make AutomationProvider::WindowSimulateDrag use SendInput instead of SendMessage r5117 dragged_tab_controller.cc (delegate NULL setting) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5636 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc21
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc2
2 files changed, 15 insertions, 8 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index 0bca5f1..db605a4 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -152,9 +152,6 @@ 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.
}
@@ -219,6 +216,8 @@ 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.
@@ -338,14 +337,14 @@ gfx::Point DraggedTabController::GetWindowCreatePoint() const {
void DraggedTabController::ChangeDraggedContents(TabContents* new_contents) {
if (dragged_contents_) {
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_) {
NotificationService::current()->AddObserver(this,
- NOTIFY_TAB_CONTENTS_DESTROYED,
- Source<TabContents>(dragged_contents_));
+ NOTIFY_TAB_CONTENTS_DESTROYED,
+ Source<TabContents>(dragged_contents_));
}
}
@@ -687,6 +686,14 @@ 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)
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 8a3db08..47329c5 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -570,7 +570,7 @@ void TabStrip::DestroyDraggedSourceTab(Tab* tab) {
std::vector<TabData>::iterator it = tab_data_.begin();
for (; it != tab_data_.end(); ++it) {
if (it->tab == tab) {
- //NOTREACHED() << "Leaving in an inconsistent state!";
+ NOTREACHED() << "Leaving in an inconsistent state!";
tab_data_.erase(it);
break;
}