diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-26 20:11:14 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-26 20:11:14 +0000 |
commit | 198d2a8762562303eff56e395408c171f967224a (patch) | |
tree | 1562f54111448f250d3514a18b567696d51a6cc1 /ui/views/window | |
parent | c2c05b561f5fd0d39744c87e41177ceeb22b29b7 (diff) | |
download | chromium_src-198d2a8762562303eff56e395408c171f967224a.zip chromium_src-198d2a8762562303eff56e395408c171f967224a.tar.gz chromium_src-198d2a8762562303eff56e395408c171f967224a.tar.bz2 |
views: Make SimpleMessageBoxViews ref-counted to make sure they get deleted at the right time.
Multiple SimpleMessageBoxViews can show up at the same time. Each of these
starts a nested message-loop. However, these SimpleMessageBoxViews can be
deleted in any order. This creates problems if a box in an inner-loop gets
destroyed before a box in an outer-loop. So to avoid this, ref-counting is
used so that the SimpleMessageBoxViews gets deleted at the right time.
BUG=134471
TEST=manually
Review URL: https://chromiumcodereview.appspot.com/10669032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/window')
-rw-r--r-- | ui/views/window/dialog_delegate.cc | 5 | ||||
-rw-r--r-- | ui/views/window/dialog_delegate.h | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc index dfc6897..3922802 100644 --- a/ui/views/window/dialog_delegate.cc +++ b/ui/views/window/dialog_delegate.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,6 +15,9 @@ namespace views { DialogDelegate* DialogDelegate::AsDialogDelegate() { return this; } +DialogDelegate::~DialogDelegate() { +} + int DialogDelegate::GetDialogButtons() const { return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; } diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h index 28af328..34a8bb5 100644 --- a/ui/views/window/dialog_delegate.h +++ b/ui/views/window/dialog_delegate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,6 +31,8 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { public: virtual DialogDelegate* AsDialogDelegate() OVERRIDE; + virtual ~DialogDelegate(); + // Returns a mask specifying which of the available DialogButtons are visible // for the dialog. Note: If an OK button is provided, you should provide a // CANCEL button. A dialog box with just an OK button is frowned upon and |