summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tabs/tab_gtk.h
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 20:03:37 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-26 20:03:37 +0000
commita7d8894b94d271931f4c04900030f93022589b03 (patch)
tree69eb53222d1f2c35da58a01bc78ac81d881584c9 /chrome/browser/gtk/tabs/tab_gtk.h
parenta4fc8d30896e63e7074ac06dbd7b13b00732f3c0 (diff)
downloadchromium_src-a7d8894b94d271931f4c04900030f93022589b03.zip
chromium_src-a7d8894b94d271931f4c04900030f93022589b03.tar.gz
chromium_src-a7d8894b94d271931f4c04900030f93022589b03.tar.bz2
Implement dragging a tab out of a TabStripGtk into its own browser window.
BUG=none TEST=Open a browser window with two tabs, pull one of the tabs out of the tab strip. On release, a new window should be created with the dragged tab contents. Review URL: http://codereview.chromium.org/113787 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16894 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs/tab_gtk.h')
-rw-r--r--chrome/browser/gtk/tabs/tab_gtk.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/gtk/tabs/tab_gtk.h b/chrome/browser/gtk/tabs/tab_gtk.h
index df8dfe9..6e2296e 100644
--- a/chrome/browser/gtk/tabs/tab_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_gtk.h
@@ -70,7 +70,7 @@ class TabGtk : public TabRendererGtk {
// Access the delegate.
TabDelegate* delegate() const { return delegate_; }
- GtkWidget* widget() const { return event_box_.get(); }
+ GtkWidget* widget() const { return event_box_; }
// Used to set/check whether this Tab is being animated closed.
void set_closing(bool closing) { closing_ = closing; }
@@ -139,8 +139,13 @@ class TabGtk : public TabRendererGtk {
// The context menu controller.
scoped_ptr<ContextMenuController> menu_controller_;
- // The windowless widget used to collect input events for the tab.
- OwnedWidgetGtk event_box_;
+ // The windowless widget used to collect input events for the tab. We can't
+ // use an OwnedWidgetGtk because of the way the dragged tab controller
+ // destroys the source tab. The source tab is destroyed when the drag ends
+ // before we let gtk handle the end of the drag. This results in the widget
+ // having an extra reference, which will cause OwnedWidgetGtk.Destroy to
+ // DCHECK.
+ GtkWidget* event_box_;
// True if this tab is being dragged.
bool dragging_;