Skip to content
Snippets Groups Projects
Commit 3c59dcbb authored by johnnyg@chromium.org's avatar johnnyg@chromium.org
Browse files

Merge 75767 - It's not safe to delete the balloon view during...

Merge 75767 - 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

TBR=johnnyg@chromium.org
Review URL: http://codereview.chromium.org/6580024

git-svn-id: svn://svn.chromium.org/chrome/branches/648/src@75848 0039d316-1c4b-4281-b951-d872f2087c98
parent ce4252e4
No related branches found
No related tags found
No related merge requests found
......@@ -431,9 +431,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) {
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment