OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/ui/app_modal_dialogs/message_box_handler.h" | 5 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "app/text_elider.h" | 9 #include "app/text_elider.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void RunJavascriptMessageBox(Profile* profile, | 63 void RunJavascriptMessageBox(Profile* profile, |
64 JavaScriptAppModalDialogDelegate* delegate, | 64 JavaScriptAppModalDialogDelegate* delegate, |
65 const GURL& frame_url, | 65 const GURL& frame_url, |
66 int dialog_flags, | 66 int dialog_flags, |
67 const std::wstring& message_text, | 67 const std::wstring& message_text, |
68 const std::wstring& default_prompt_text, | 68 const std::wstring& default_prompt_text, |
69 bool display_suppress_checkbox, | 69 bool display_suppress_checkbox, |
70 IPC::Message* reply_msg) { | 70 IPC::Message* reply_msg) { |
71 bool is_alert = dialog_flags == MessageBoxFlags::kIsJavascriptAlert; | 71 bool is_alert = dialog_flags == MessageBoxFlags::kIsJavascriptAlert; |
72 std::wstring title = GetTitle(profile, is_alert, frame_url); | 72 std::wstring title = GetTitle(profile, is_alert, frame_url); |
73 Singleton<AppModalDialogQueue>()->AddDialog(new JavaScriptAppModalDialog( | 73 AppModalDialogQueue::GetInstance()->AddDialog(new JavaScriptAppModalDialog( |
74 delegate, title, dialog_flags, message_text, default_prompt_text, | 74 delegate, title, dialog_flags, message_text, default_prompt_text, |
75 display_suppress_checkbox, false, reply_msg)); | 75 display_suppress_checkbox, false, reply_msg)); |
76 } | 76 } |
77 | 77 |
78 void RunBeforeUnloadDialog(TabContents* tab_contents, | 78 void RunBeforeUnloadDialog(TabContents* tab_contents, |
79 const std::wstring& message_text, | 79 const std::wstring& message_text, |
80 IPC::Message* reply_msg) { | 80 IPC::Message* reply_msg) { |
81 std::wstring full_message = | 81 std::wstring full_message = |
82 message_text + L"\n\n" + | 82 message_text + L"\n\n" + |
83 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); | 83 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); |
84 Singleton<AppModalDialogQueue>()->AddDialog(new JavaScriptAppModalDialog( | 84 AppModalDialogQueue::GetInstance()->AddDialog(new JavaScriptAppModalDialog( |
85 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), | 85 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), |
86 MessageBoxFlags::kIsJavascriptConfirm, message_text, std::wstring(), | 86 MessageBoxFlags::kIsJavascriptConfirm, message_text, std::wstring(), |
87 false, true, reply_msg)); | 87 false, true, reply_msg)); |
88 } | 88 } |
OLD | NEW |