Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: chrome/browser/ui/views/tabs/default_tab_drag_controller.cc

Issue 8921032: Adds some debugging code in hopes of identifying a crasher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/tab_contents/tab_contents_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
index 00e509b3c3084d4abb9bb24f11c758c32111c9ca..cd76630f06cbf97ae092913ddf7712d653acac17 100644
--- a/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/default_tab_drag_controller.cc
@@ -24,6 +24,7 @@
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/user_metrics.h"
#include "content/public/browser/notification_details.h"
+#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "grit/theme_resources.h"
@@ -360,6 +361,11 @@ void DefaultTabDragController::Init(
}
InitWindowCreatePoint();
initial_selection_model_.Copy(initial_selection_model);
+
+ registrar_.Add(
+ this,
+ content::NOTIFICATION_TAB_CONTENTS_DELEGATE_DESTROYED,
+ content::NotificationService::AllSources());
}
void DefaultTabDragController::InitTabDragData(BaseTab* tab,
@@ -471,6 +477,13 @@ void DefaultTabDragController::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
+ if (type == content::NOTIFICATION_TAB_CONTENTS_DELEGATE_DESTROYED) {
+ TabContentsDelegate* delegate =
+ content::Source<TabContentsDelegate>(source).ptr();
+ for (size_t i = 0; i < drag_data_.size(); ++i)
+ CHECK_NE(delegate, drag_data_[i].original_delegate);
+ return;
+ }
DCHECK_EQ(type, content::NOTIFICATION_TAB_CONTENTS_DESTROYED);
TabContents* destroyed_contents = content::Source<TabContents>(source).ptr();
for (size_t i = 0; i < drag_data_.size(); ++i) {
« no previous file with comments | « no previous file | content/browser/tab_contents/tab_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698