diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 16:32:21 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 16:32:21 +0000 |
commit | ef73740190a357c77f4d49ebb0270007a1cc586b (patch) | |
tree | 33476a2ae6a1742687af0928793566d16b0c9d52 /views | |
parent | 97fee079f76d2f7099f4fce9750fe2dcb62609a0 (diff) | |
download | chromium_src-ef73740190a357c77f4d49ebb0270007a1cc586b.zip chromium_src-ef73740190a357c77f4d49ebb0270007a1cc586b.tar.gz chromium_src-ef73740190a357c77f4d49ebb0270007a1cc586b.tar.bz2 |
Lands http://codereview.chromium.org/198010 for Oshima:
* Fix seg fault in deleting view from RemoveTabAtIndex
* move initialization of tabbed page to NativeControlCreated
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/196055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/combobox/native_combobox_gtk.cc | 10 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/views/controls/combobox/native_combobox_gtk.cc b/views/controls/combobox/native_combobox_gtk.cc index 3075cce..89d2b38 100644 --- a/views/controls/combobox/native_combobox_gtk.cc +++ b/views/controls/combobox/native_combobox_gtk.cc @@ -114,15 +114,15 @@ void NativeComboboxGtk::CreateNativeControl() { G_CALLBACK(CallChanged), this); NativeControlCreated(widget); - - // Set the data from combobox - UpdateFromModel(); - // and show the 1st item by default. - gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0); } void NativeComboboxGtk::NativeControlCreated(GtkWidget* native_control) { NativeControlGtk::NativeControlCreated(native_control); + + // Set the data from combobox + UpdateFromModel(); + // and show the 1st item by default. + gtk_combo_box_set_active(GTK_COMBO_BOX(native_control), 0); } //////////////////////////////////////////////////////////////////////////////// diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index 855ce805..3a454fe 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -60,8 +60,17 @@ View* NativeTabbedPaneGtk::RemoveTabAtIndex(int index) { // last tab. nothing to select. } } + + GtkWidget* page = + gtk_notebook_get_nth_page(GTK_NOTEBOOK(native_view()), index); + WidgetGtk* widget = WidgetGtk::GetViewForNative(page); + + // detach the content view from widget so that we can delete widget + // without destroying the content view. View* removed_tab = GetTabViewAt(index); + widget->GetRootView()->RemoveChildView(removed_tab); + // widget delete itself when native_view is deleted. gtk_notebook_remove_page(GTK_NOTEBOOK(native_view()), index); return removed_tab; |