summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:15:46 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-05 22:15:46 +0000
commit9e241cc8a7320c0a818da0ddac1bc3910fc1b60a (patch)
tree642a54ac13c00ee0e5de527b31cd62d42f2f1b80
parentdd19d64a0d55eea06060c1f0a4b2d48d0c6d94cc (diff)
downloadchromium_src-9e241cc8a7320c0a818da0ddac1bc3910fc1b60a.zip
chromium_src-9e241cc8a7320c0a818da0ddac1bc3910fc1b60a.tar.gz
chromium_src-9e241cc8a7320c0a818da0ddac1bc3910fc1b60a.tar.bz2
Make sure the tabstrip we're dragging in to is compatible with the source tabstrip.
BUG=none TEST=Drag tabs between tabstrips. Review URL: http://codereview.chromium.org/119258 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17780 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc4
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc4
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.h4
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;