summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 17:03:42 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 17:03:42 +0000
commitcb4996397f1857ada4419fd166abf4567aa3556e (patch)
tree1c6d8ee1a70d2c2a76e8b33d92601f5c8861807b /chrome
parentfeb2ebfe608c307d3731943616a3ed6eb53b9ba1 (diff)
downloadchromium_src-cb4996397f1857ada4419fd166abf4567aa3556e.zip
chromium_src-cb4996397f1857ada4419fd166abf4567aa3556e.tar.gz
chromium_src-cb4996397f1857ada4419fd166abf4567aa3556e.tar.bz2
Fix crash in DialogClientView caused by recursion of Close calls. When migrating from Window to DialogClientView, I neglected to insert the check into this function to see if the dialog had already been accepted by the user before trying to abort.
B=1304032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/views/dialog_client_view.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/views/dialog_client_view.cc b/chrome/views/dialog_client_view.cc
index 0ce9293..d942a2f 100644
--- a/chrome/views/dialog_client_view.cc
+++ b/chrome/views/dialog_client_view.cc
@@ -206,12 +206,14 @@ void DialogClientView::CancelWindow() {
// DialogClientView, ClientView overrides:
bool DialogClientView::CanClose() const {
- DialogDelegate* dd = GetDialogDelegate();
- int buttons = dd->GetDialogButtons();
- if (buttons & DialogDelegate::DIALOGBUTTON_CANCEL)
- return dd->Cancel();
- if (buttons & DialogDelegate::DIALOGBUTTON_OK)
- return dd->Accept(true);
+ if (!accepted_) {
+ DialogDelegate* dd = GetDialogDelegate();
+ int buttons = dd->GetDialogButtons();
+ if (buttons & DialogDelegate::DIALOGBUTTON_CANCEL)
+ return dd->Cancel();
+ if (buttons & DialogDelegate::DIALOGBUTTON_OK)
+ return dd->Accept(true);
+ }
return true;
}