From 1f46007516b8ab87a9089bfab64621595b869e54 Mon Sep 17 00:00:00 2001 From: "jcampan@chromium.org" Date: Thu, 28 May 2009 17:02:07 +0000 Subject: This CL is a clean-up of the app_modal_dialog_queue.cc in an attempt to fix a bug 10699. Not sure what is causing the crasher. Hopefully after this clean-up we'll get a different stack-trace that might help. BUG=10699 TEST=Make sure alert/confirm boxes work properly. make sure a background tab that shows a (delayed) alert box works. Same with a background browser. Review URL: http://codereview.chromium.org/113932 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17078 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/jsmessage_box_handler.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'chrome/browser/jsmessage_box_handler.cc') diff --git a/chrome/browser/jsmessage_box_handler.cc b/chrome/browser/jsmessage_box_handler.cc index 151a33a..3923646 100644 --- a/chrome/browser/jsmessage_box_handler.cc +++ b/chrome/browser/jsmessage_box_handler.cc @@ -68,9 +68,11 @@ void RunJavascriptMessageBox(TabContents* tab_contents, bool display_suppress_checkbox, IPC::Message* reply_msg) { std::wstring title = GetWindowTitle(tab_contents, frame_url, dialog_flags); - AppModalDialogQueue::AddDialog(new AppModalDialog(tab_contents, title, - dialog_flags, MakeTextSafe(message_text), default_prompt_text, - display_suppress_checkbox, false, reply_msg)); + Singleton()->AddDialog( + new AppModalDialog(tab_contents, title, + dialog_flags, MakeTextSafe(message_text), + default_prompt_text, display_suppress_checkbox, + false, reply_msg)); } void RunBeforeUnloadDialog(TabContents* tab_contents, @@ -79,7 +81,7 @@ void RunBeforeUnloadDialog(TabContents* tab_contents, std::wstring full_message = message_text + L"\n\n" + l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); - AppModalDialogQueue::AddDialog(new AppModalDialog( + Singleton()->AddDialog(new AppModalDialog( tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), MessageBoxFlags::kIsJavascriptConfirm, MakeTextSafe(message_text), std::wstring(), false, true, reply_msg)); -- cgit v1.1