| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/jsmessage_box_handler.h" | 5 #include "chrome/browser/jsmessage_box_handler.h" |
| 6 | 6 |
| 7 #include "app/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 void RunJavascriptMessageBox(TabContents* tab_contents, | 63 void RunJavascriptMessageBox(TabContents* tab_contents, |
| 64 const GURL& frame_url, | 64 const GURL& frame_url, |
| 65 int dialog_flags, | 65 int dialog_flags, |
| 66 const std::wstring& message_text, | 66 const std::wstring& message_text, |
| 67 const std::wstring& default_prompt_text, | 67 const std::wstring& default_prompt_text, |
| 68 bool display_suppress_checkbox, | 68 bool display_suppress_checkbox, |
| 69 IPC::Message* reply_msg) { | 69 IPC::Message* reply_msg) { |
| 70 std::wstring title = GetWindowTitle(tab_contents, frame_url, dialog_flags); | 70 std::wstring title = GetWindowTitle(tab_contents, frame_url, dialog_flags); |
| 71 AppModalDialogQueue::AddDialog(new AppModalDialog(tab_contents, title, | 71 Singleton<AppModalDialogQueue>()->AddDialog( |
| 72 dialog_flags, MakeTextSafe(message_text), default_prompt_text, | 72 new AppModalDialog(tab_contents, title, |
| 73 display_suppress_checkbox, false, reply_msg)); | 73 dialog_flags, MakeTextSafe(message_text), |
| 74 default_prompt_text, display_suppress_checkbox, |
| 75 false, reply_msg)); |
| 74 } | 76 } |
| 75 | 77 |
| 76 void RunBeforeUnloadDialog(TabContents* tab_contents, | 78 void RunBeforeUnloadDialog(TabContents* tab_contents, |
| 77 const std::wstring& message_text, | 79 const std::wstring& message_text, |
| 78 IPC::Message* reply_msg) { | 80 IPC::Message* reply_msg) { |
| 79 std::wstring full_message = | 81 std::wstring full_message = |
| 80 message_text + L"\n\n" + | 82 message_text + L"\n\n" + |
| 81 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); | 83 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); |
| 82 AppModalDialogQueue::AddDialog(new AppModalDialog( | 84 Singleton<AppModalDialogQueue>()->AddDialog(new AppModalDialog( |
| 83 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), | 85 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), |
| 84 MessageBoxFlags::kIsJavascriptConfirm, MakeTextSafe(message_text), | 86 MessageBoxFlags::kIsJavascriptConfirm, MakeTextSafe(message_text), |
| 85 std::wstring(), false, true, reply_msg)); | 87 std::wstring(), false, true, reply_msg)); |
| 86 } | 88 } |
| OLD | NEW |