summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xchrome/browser/views/find_bar_host_gtk.cc5
-rw-r--r--chrome/browser/views/location_bar_view.cc6
-rw-r--r--views/controls/native/native_view_host.cc6
3 files changed, 7 insertions, 10 deletions
diff --git a/chrome/browser/views/find_bar_host_gtk.cc b/chrome/browser/views/find_bar_host_gtk.cc
index 6b05f92..e517407 100755
--- a/chrome/browser/views/find_bar_host_gtk.cc
+++ b/chrome/browser/views/find_bar_host_gtk.cc
@@ -24,7 +24,10 @@ void FindBarHost::AudibleAlert() {
}
views::Widget* FindBarHost::CreateHost() {
- return new views::WidgetGtk(views::WidgetGtk::TYPE_CHILD);
+ views::WidgetGtk* host = new views::WidgetGtk(views::WidgetGtk::TYPE_CHILD);
+ // We own the host.
+ host->set_delete_on_destroy(false);
+ return host;
}
void FindBarHost::SetDialogPositionNative(const gfx::Rect& new_pos,
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index b7a97a7..ea6b526 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -114,12 +114,6 @@ LocationBarView::LocationBarView(Profile* profile,
}
LocationBarView::~LocationBarView() {
-#if defined(OS_LINUX)
- // We must release the ref that the NativeViewHost has on the
- // AutocompleteEditViewGtk, otherwise its internal OwnedWidgetGtk will
- // complain about its refcount not being 1 as it is destroyed.
- location_entry_view_->Detach();
-#endif
DeletePageActionViews();
}
diff --git a/views/controls/native/native_view_host.cc b/views/controls/native/native_view_host.cc
index 9cbeaf7..5f22a00 100644
--- a/views/controls/native/native_view_host.cc
+++ b/views/controls/native/native_view_host.cc
@@ -52,9 +52,9 @@ void NativeViewHost::SetPreferredSize(const gfx::Size& size) {
}
void NativeViewHost::NativeViewDestroyed() {
- // TODO(beng): figure out if this should/could call Detach instead since as it
- // stands right now this object is left in an inconsistent state.
- native_view_ = NULL;
+ // Detach so we can clear our state and notify the native_wrapper_ to release
+ // ref on the native view.
+ Detach();
}
////////////////////////////////////////////////////////////////////////////////