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 "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/tab_contents/tab_contents.h" | 12 #include "chrome/browser/tab_contents/tab_contents.h" |
13 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 13 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
14 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" | 14 #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "gfx/font.h" | |
18 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
19 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
20 #include "grit/chromium_strings.h" | 19 #include "grit/chromium_strings.h" |
21 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
22 #include "ui/base/message_box_flags.h" | 21 #include "ui/base/message_box_flags.h" |
23 #include "ui/base/text/text_elider.h" | 22 #include "ui/base/text/text_elider.h" |
| 23 #include "ui/gfx/font.h" |
24 | 24 |
25 static std::wstring GetTitle(Profile* profile, | 25 static std::wstring GetTitle(Profile* profile, |
26 bool is_alert, | 26 bool is_alert, |
27 const GURL& frame_url) { | 27 const GURL& frame_url) { |
28 ExtensionService* extensions_service = profile->GetExtensionService(); | 28 ExtensionService* extensions_service = profile->GetExtensionService(); |
29 if (extensions_service) { | 29 if (extensions_service) { |
30 const Extension* extension = | 30 const Extension* extension = |
31 extensions_service->GetExtensionByURL(frame_url); | 31 extensions_service->GetExtensionByURL(frame_url); |
32 if (!extension) | 32 if (!extension) |
33 extension = extensions_service->GetExtensionByWebExtent(frame_url); | 33 extension = extensions_service->GetExtensionByWebExtent(frame_url); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 tab_contents, | 84 tab_contents, |
85 UTF16ToWideHack( | 85 UTF16ToWideHack( |
86 l10n_util::GetStringUTF16(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE)), | 86 l10n_util::GetStringUTF16(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE)), |
87 ui::MessageBoxFlags::kIsJavascriptConfirm, | 87 ui::MessageBoxFlags::kIsJavascriptConfirm, |
88 message_text, | 88 message_text, |
89 std::wstring(), | 89 std::wstring(), |
90 false, | 90 false, |
91 true, | 91 true, |
92 reply_msg)); | 92 reply_msg)); |
93 } | 93 } |
OLD | NEW |