Index: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc |
=================================================================== |
--- chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc (revision 147038) |
+++ chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc (working copy) |
@@ -1279,11 +1279,19 @@ |
return; |
std::vector<TabGtk*> tabs; |
+ bool tab_found = false; |
for (size_t i = 0; i < model()->selection_model().size(); i++) { |
- TabGtk* tab = GetTabAt(model()->selection_model().selected_indices()[i]); |
- if (!tab->closing()) |
- tabs.push_back(tab); |
+ TabGtk* selected_tab = |
+ GetTabAt(model()->selection_model().selected_indices()[i]); |
sky
2012/07/18 21:12:04
In looking at this again, this should be GetTabAtA
|
+ if (!selected_tab->closing()) { |
+ tabs.push_back(selected_tab); |
+ if (selected_tab == tab) |
+ tab_found = true; |
+ } |
} |
+ // If the tab was not in the selection we cannot start the drag operation. |
+ if (!tab_found) |
sky
2012/07/18 21:12:04
This should be a DCHECK, and you should make it a
|
+ return; |
drag_controller_.reset(new DraggedTabControllerGtk(this, tab, tabs)); |
drag_controller_->CaptureDragInfo(point); |