diff options
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.h | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc index 59c69ce..db61ce9 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc @@ -287,7 +287,9 @@ TabStripGtk* DraggedTabControllerGtk::GetTabStripForPoint( return NULL; TabStripGtk* other_tabstrip = browser->tabstrip(); - // TODO(jhawkins): Make sure the tabstrips are compatible. + if (!other_tabstrip->IsCompatibleWith(source_tabstrip_)) + return NULL; + return GetTabStripIfItContains(other_tabstrip, screen_point); } diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index d145296..8db7a38 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -544,6 +544,10 @@ void TabStripGtk::UpdateLoadingAnimations() { gtk_widget_queue_draw(tabstrip_.get()); } +bool TabStripGtk::IsCompatibleWith(TabStripGtk* other) { + return model_->profile() == other->model()->profile(); +} + bool TabStripGtk::IsAnimating() const { return active_animation_.get() != NULL; } diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h index cf90088..0b3a809 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.h +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h @@ -59,6 +59,10 @@ class TabStripGtk : public TabStripModelObserver, // Updates loading animations for the TabStrip. void UpdateLoadingAnimations(); + // Return true if this tab strip is compatible with the provided tab strip. + // Compatible tab strips can transfer tabs during drag and drop. + bool IsCompatibleWith(TabStripGtk* other); + // Returns true if Tabs in this TabStrip are currently changing size or // position. bool IsAnimating() const; |