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/l10n_util.h" |
7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
8 #include "chrome/browser/app_modal_dialog_queue.h" | 9 #include "chrome/browser/app_modal_dialog_queue.h" |
9 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profile.h" |
11 #include "chrome/browser/tab_contents/tab_contents.h" | 12 #include "chrome/browser/tab_contents/tab_contents.h" |
12 #include "chrome/common/gfx/text_elider.h" | 13 #include "chrome/common/gfx/text_elider.h" |
13 #include "chrome/common/l10n_util.h" | |
14 #include "chrome/common/message_box_flags.h" | 14 #include "chrome/common/message_box_flags.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/common/pref_service.h" | 16 #include "chrome/common/pref_service.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const size_t kMaxReasonableTextLength = 2048; | 22 const size_t kMaxReasonableTextLength = 2048; |
23 | 23 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const std::wstring& message_text, | 77 const std::wstring& message_text, |
78 IPC::Message* reply_msg) { | 78 IPC::Message* reply_msg) { |
79 std::wstring full_message = | 79 std::wstring full_message = |
80 message_text + L"\n\n" + | 80 message_text + L"\n\n" + |
81 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); | 81 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); |
82 AppModalDialogQueue::AddDialog(new AppModalDialog( | 82 AppModalDialogQueue::AddDialog(new AppModalDialog( |
83 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), | 83 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), |
84 MessageBoxFlags::kIsJavascriptConfirm, MakeTextSafe(message_text), | 84 MessageBoxFlags::kIsJavascriptConfirm, MakeTextSafe(message_text), |
85 std::wstring(), false, true, reply_msg)); | 85 std::wstring(), false, true, reply_msg)); |
86 } | 86 } |
OLD | NEW |