diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 18:46:53 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 18:46:53 +0000 |
commit | 6556f27c4b7d7bd6e77a3c43c3f0518afbb770f9 (patch) | |
tree | 46e18997a0aa686549d84b4ef05687c4911715d9 /chrome | |
parent | f9d040203b92bbe05f5eb613dfd3e2732e084b0f (diff) | |
download | chromium_src-6556f27c4b7d7bd6e77a3c43c3f0518afbb770f9.zip chromium_src-6556f27c4b7d7bd6e77a3c43c3f0518afbb770f9.tar.gz chromium_src-6556f27c4b7d7bd6e77a3c43c3f0518afbb770f9.tar.bz2 |
It's not safe to delete the balloon view during MenuDelegate::StoppedShowing, since it tears down the menu model. Do this as a delayed task instead.
BUG=51177
TEST=autoclose notification with wrench menu open
Review URL: http://codereview.chromium.org/6541082
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/notifications/balloon_view_gtk.h | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc index f9bf94f..9de804e2 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc @@ -459,9 +459,13 @@ void BalloonViewImpl::OnOptionsMenuButton(GtkWidget* widget, // Called when the menu stops showing. void BalloonViewImpl::StoppedShowing() { - if (pending_close_) - DelayedClose(false); menu_showing_ = false; + if (pending_close_) { + MessageLoop::current()->PostTask( + FROM_HERE, + method_factory_.NewRunnableMethod( + &BalloonViewImpl::DelayedClose, false)); + } } gboolean BalloonViewImpl::OnDestroy(GtkWidget* widget) { diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h index 9b02c0c..2d297d2 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h @@ -63,7 +63,9 @@ class BalloonViewImpl : public BalloonView, // ui::AnimationDelegate interface. virtual void AnimationProgressed(const ui::Animation* animation); - // Do the delayed close work. + // Do the delayed close work. The balloon and all view components will be + // destroyed at this time, so it shouldn't be called while still processing + // an event that relies on them. void DelayedClose(bool by_user); // The height of the balloon's shelf. |