summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorglotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 14:09:50 +0000
committerglotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 14:09:50 +0000
commit66cb64e35bfcfda89493e78183864ce049da4384 (patch)
treee82adf6940c87b68687916971fd934f8bcbf0650 /views
parent5e9058ac7be7c937dd3de29e233126b98efe1435 (diff)
downloadchromium_src-66cb64e35bfcfda89493e78183864ce049da4384.zip
chromium_src-66cb64e35bfcfda89493e78183864ce049da4384.tar.gz
chromium_src-66cb64e35bfcfda89493e78183864ce049da4384.tar.bz2
Revert 85120 - Removing DeleteSoon() from WigetGtk so it behaves like WidgetWin
BUG=chromium-os:15129 TEST=tests Review URL: http://codereview.chromium.org/7002029 TBR=glotov@google.com Review URL: http://codereview.chromium.org/7016017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85127 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_gtk.cc18
-rw-r--r--views/widget/widget_gtk.h4
-rw-r--r--views/window/window_gtk.cc3
-rw-r--r--views/window/window_gtk.h1
4 files changed, 9 insertions, 17 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 5122904..b506dac 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -322,8 +322,6 @@ WidgetGtk::WidgetGtk()
}
WidgetGtk::~WidgetGtk() {
- if (!delete_on_destroy_ && widget_)
- CloseNow();
// We need to delete the input method before calling DestroyRootView(),
// because it'll set focus_manager_ to NULL.
input_method_.reset();
@@ -902,10 +900,10 @@ void WidgetGtk::MoveAbove(gfx::NativeView native_view) {
}
void WidgetGtk::SetShape(gfx::NativeRegion region) {
- if (widget_ && widget_->window) {
- gdk_window_shape_combine_region(widget_->window, region, 0, 0);
- gdk_region_destroy(region);
- }
+ DCHECK(widget_);
+ DCHECK(widget_->window);
+ gdk_window_shape_combine_region(widget_->window, region, 0, 0);
+ gdk_region_destroy(region);
}
void WidgetGtk::Close() {
@@ -1312,9 +1310,11 @@ void WidgetGtk::OnDestroy(GtkWidget* object) {
// NULL out pointers here since we might still be in an observerer list
// until delstion happens.
widget_ = window_contents_ = NULL;
- OnDestroyed();
- if (delete_on_destroy_)
- delete this;
+ if (delete_on_destroy_) {
+ // Delays the deletion of this WidgetGtk as we want its children to have
+ // access to it when destroyed.
+ MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+ }
}
void WidgetGtk::OnShow(GtkWidget* widget) {
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index d60a82f..eaa29cd 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -253,10 +253,6 @@ class WidgetGtk : public Widget,
CHROMEGTK_CALLBACK_0(WidgetGtk, void, OnMap);
CHROMEGTK_CALLBACK_0(WidgetGtk, void, OnHide);
- // Invoked when the widget is destroyed and right before the object
- // destruction. Useful for overriding.
- virtual void OnDestroyed() { }
-
// Invoked when gtk grab is stolen by other GtkWidget in the same
// application.
virtual void HandleGtkGrabBroke();
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index d55d657..0e7a6f2 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -443,9 +443,6 @@ void WindowGtk::SaveWindowPosition() {
void WindowGtk::OnDestroy(GtkWidget* widget) {
delegate_->OnNativeWindowDestroying();
WidgetGtk::OnDestroy(widget);
-}
-
-void WindowGtk::OnDestroyed() {
delegate_->OnNativeWindowDestroyed();
}
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index 72782a5..e659e4a 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -91,7 +91,6 @@ class WindowGtk : public WidgetGtk, public NativeWindow, public Window {
friend class Window;
virtual void OnDestroy(GtkWidget* widget);
- virtual void OnDestroyed();
private:
static gboolean CallConfigureEvent(GtkWidget* widget,