diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 02:26:07 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 02:26:07 +0000 |
commit | f3f2017007c1424a21b6cf5586c59a1fe2cf456a (patch) | |
tree | 6338100c482373f59d30aa84be517bb3cd54a58c /chrome/browser | |
parent | e5380f532572a127962f40d242650d136a51d896 (diff) | |
download | chromium_src-f3f2017007c1424a21b6cf5586c59a1fe2cf456a.zip chromium_src-f3f2017007c1424a21b6cf5586c59a1fe2cf456a.tar.gz chromium_src-f3f2017007c1424a21b6cf5586c59a1fe2cf456a.tar.bz2 |
Linux: fixes for tab contents switching
Previously, removing a view_ from its container destroyed it. We fix
this by disabling GTK's auto reference stealing.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_toolbar_view_gtk.cc | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/tab_contents_container_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents_view_gtk.cc | 1 |
4 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 7e386f2..5a88b68 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1441,9 +1441,13 @@ void Browser::TabSelectedAt(TabContents* old_contents, ProcessPendingUIUpdates(); if (old_contents) { +#if defined(OS_WIN) // Save what the user's currently typing, so it can be restored when we // switch back to this tab. window_->GetLocationBar()->SaveStateToContents(old_contents); +#else + NOTIMPLEMENTED(); +#endif } // Propagate the profile to the location bar. diff --git a/chrome/browser/gtk/browser_toolbar_view_gtk.cc b/chrome/browser/gtk/browser_toolbar_view_gtk.cc index e058057..48eed95 100644 --- a/chrome/browser/gtk/browser_toolbar_view_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_view_gtk.cc @@ -217,9 +217,6 @@ void BrowserToolbarGtk::OnEntryActivate(GtkEntry *entry, BrowserToolbarGtk* toolbar) { GURL dest(URLFixerUpper::FixupURL(std::string(gtk_entry_get_text(entry)), std::string())); - toolbar->browser_->OpenURLFromTab(NULL, dest, GURL(), - CURRENT_TAB, - PageTransition::TYPED); toolbar->browser_->GetSelectedTabContents()-> OpenURL(dest, GURL(), CURRENT_TAB, PageTransition::TYPED); } diff --git a/chrome/browser/gtk/tab_contents_container_gtk.cc b/chrome/browser/gtk/tab_contents_container_gtk.cc index 46a8d42..78eeb0d 100644 --- a/chrome/browser/gtk/tab_contents_container_gtk.cc +++ b/chrome/browser/gtk/tab_contents_container_gtk.cc @@ -27,9 +27,8 @@ void TabContentsContainerGtk::AddContainerToBox(GtkWidget* box) { void TabContentsContainerGtk::SetTabContents(TabContents* tab_contents) { if (tab_contents_) { gfx::NativeView widget = tab_contents_->GetNativeView(); - if (widget) { + if (widget) gtk_container_remove(GTK_CONTAINER(vbox_), widget); - } tab_contents_->WasHidden(); @@ -46,6 +45,7 @@ void TabContentsContainerGtk::SetTabContents(TabContents* tab_contents) { gfx::NativeView widget = tab_contents_->GetNativeView(); if (widget) { gtk_box_pack_start(GTK_BOX(vbox_), widget, TRUE, TRUE, 0); + gtk_widget_show_all(widget); } } } diff --git a/chrome/browser/tab_contents/web_contents_view_gtk.cc b/chrome/browser/tab_contents/web_contents_view_gtk.cc index c63d2bf..62fbd3a 100644 --- a/chrome/browser/tab_contents/web_contents_view_gtk.cc +++ b/chrome/browser/tab_contents/web_contents_view_gtk.cc @@ -29,6 +29,7 @@ WebContentsView* WebContentsView::Create(WebContents* web_contents) { WebContentsViewGtk::WebContentsViewGtk(WebContents* web_contents) : web_contents_(web_contents), vbox_(gtk_vbox_new(FALSE, 0)) { + g_object_ref_sink(vbox_); } WebContentsViewGtk::~WebContentsViewGtk() { |