| 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/message_box_handler.h" | 5 #include "chrome/browser/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" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/browser/app_modal_dialog_queue.h" | 13 #include "chrome/browser/app_modal_dialog_queue.h" |
| 14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/browsing_data_local_storage_helper.h" | |
| 16 #include "chrome/browser/cookie_modal_dialog.h" | |
| 17 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" | |
| 18 #include "chrome/browser/extensions/extensions_service.h" | 15 #include "chrome/browser/extensions/extensions_service.h" |
| 19 #include "chrome/browser/js_modal_dialog.h" | 16 #include "chrome/browser/js_modal_dialog.h" |
| 20 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profile.h" |
| 21 #include "chrome/browser/tab_contents/tab_contents.h" | 18 #include "chrome/browser/tab_contents/tab_contents.h" |
| 22 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 24 #include "gfx/font.h" | 21 #include "gfx/font.h" |
| 25 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 26 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 27 #include "grit/chromium_strings.h" | 24 #include "grit/chromium_strings.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const std::wstring& message_text, | 83 const std::wstring& message_text, |
| 87 IPC::Message* reply_msg) { | 84 IPC::Message* reply_msg) { |
| 88 std::wstring full_message = | 85 std::wstring full_message = |
| 89 message_text + L"\n\n" + | 86 message_text + L"\n\n" + |
| 90 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); | 87 l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_FOOTER); |
| 91 Singleton<AppModalDialogQueue>()->AddDialog(new JavaScriptAppModalDialog( | 88 Singleton<AppModalDialogQueue>()->AddDialog(new JavaScriptAppModalDialog( |
| 92 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), | 89 tab_contents, l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE), |
| 93 MessageBoxFlags::kIsJavascriptConfirm, message_text, std::wstring(), | 90 MessageBoxFlags::kIsJavascriptConfirm, message_text, std::wstring(), |
| 94 false, true, reply_msg)); | 91 false, true, reply_msg)); |
| 95 } | 92 } |
| 96 | |
| 97 void RunCookiePrompt(TabContents* tab_contents, | |
| 98 HostContentSettingsMap* host_content_settings_map, | |
| 99 const GURL& origin, | |
| 100 const std::string& cookie_line, | |
| 101 CookiePromptModalDialogDelegate* delegate) { | |
| 102 Singleton<AppModalDialogQueue>()->AddDialog( | |
| 103 new CookiePromptModalDialog(tab_contents, host_content_settings_map, | |
| 104 origin, cookie_line, delegate)); | |
| 105 } | |
| 106 | |
| 107 void RunLocalStoragePrompt( | |
| 108 TabContents* tab_contents, | |
| 109 HostContentSettingsMap* host_content_settings_map, | |
| 110 const GURL& origin, | |
| 111 const string16& key, | |
| 112 const string16& value, | |
| 113 CookiePromptModalDialogDelegate* delegate) { | |
| 114 Singleton<AppModalDialogQueue>()->AddDialog( | |
| 115 new CookiePromptModalDialog(tab_contents, host_content_settings_map, | |
| 116 origin, key, value, delegate)); | |
| 117 } | |
| 118 | |
| 119 void RunDatabasePrompt( | |
| 120 TabContents* tab_contents, | |
| 121 HostContentSettingsMap* host_content_settings_map, | |
| 122 const GURL& origin, | |
| 123 const string16& database_name, | |
| 124 const string16& display_name, | |
| 125 unsigned long estimated_size, | |
| 126 CookiePromptModalDialogDelegate* delegate) { | |
| 127 Singleton<AppModalDialogQueue>()->AddDialog( | |
| 128 new CookiePromptModalDialog(tab_contents, host_content_settings_map, | |
| 129 origin, database_name, display_name, | |
| 130 estimated_size, delegate)); | |
| 131 } | |
| 132 | |
| 133 void RunAppCachePrompt( | |
| 134 TabContents* tab_contents, | |
| 135 HostContentSettingsMap* host_content_settings_map, | |
| 136 const GURL& manifest_url, | |
| 137 CookiePromptModalDialogDelegate* delegate) { | |
| 138 Singleton<AppModalDialogQueue>()->AddDialog( | |
| 139 new CookiePromptModalDialog(tab_contents, host_content_settings_map, | |
| 140 manifest_url, delegate)); | |
| 141 } | |
| OLD | NEW |