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 30 matching lines...) Expand all Loading... |
41 GURL::Replacements replacements; | 41 GURL::Replacements replacements; |
42 replacements.ClearUsername(); | 42 replacements.ClearUsername(); |
43 replacements.ClearPassword(); | 43 replacements.ClearPassword(); |
44 replacements.ClearPath(); | 44 replacements.ClearPath(); |
45 replacements.ClearQuery(); | 45 replacements.ClearQuery(); |
46 replacements.ClearRef(); | 46 replacements.ClearRef(); |
47 GURL clean_url = frame_url.ReplaceComponents(replacements); | 47 GURL clean_url = frame_url.ReplaceComponents(replacements); |
48 | 48 |
49 // TODO(brettw) it should be easier than this to do the correct language | 49 // TODO(brettw) it should be easier than this to do the correct language |
50 // handling without getting the accept language from the profile. | 50 // handling without getting the accept language from the profile. |
51 std::wstring base_address = gfx::ElideUrl(clean_url, ChromeFont(), 0, | 51 std::wstring base_address = gfx::ElideUrl(clean_url, gfx::Font(), 0, |
52 tab_contents->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)); | 52 tab_contents->profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)); |
53 // Force URL to have LTR directionality. | 53 // Force URL to have LTR directionality. |
54 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) | 54 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) |
55 l10n_util::WrapStringWithLTRFormatting(&base_address); | 55 l10n_util::WrapStringWithLTRFormatting(&base_address); |
56 return l10n_util::GetStringF( | 56 return l10n_util::GetStringF( |
57 is_alert ? IDS_JAVASCRIPT_ALERT_TITLE : IDS_JAVASCRIPT_MESSAGEBOX_TITLE, | 57 is_alert ? IDS_JAVASCRIPT_ALERT_TITLE : IDS_JAVASCRIPT_MESSAGEBOX_TITLE, |
58 base_address); | 58 base_address); |
59 } | 59 } |
60 | 60 |
61 } | 61 } |
(...skipping 15 matching lines...) Expand all 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 |