OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/tab_contents/web_contents.h" | 5 #include "chrome/browser/tab_contents/web_contents.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "chrome/browser/autofill_manager.h" | 12 #include "chrome/browser/autofill_manager.h" |
13 #include "chrome/browser/bookmarks/bookmark_model.h" | 13 #include "chrome/browser/bookmarks/bookmark_model.h" |
14 #include "chrome/browser/browser.h" | 14 #include "chrome/browser/browser.h" |
15 #include "chrome/browser/character_encoding.h" | 15 #include "chrome/browser/character_encoding.h" |
16 #include "chrome/browser/debugger/devtools_manager.h" | 16 #include "chrome/browser/debugger/devtools_manager.h" |
17 #include "chrome/browser/dom_operation_notification_details.h" | 17 #include "chrome/browser/dom_operation_notification_details.h" |
18 #include "chrome/browser/dom_ui/dom_ui.h" | 18 #include "chrome/browser/dom_ui/dom_ui.h" |
19 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 19 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
20 #include "chrome/browser/download/download_manager.h" | 20 #include "chrome/browser/download/download_manager.h" |
21 #include "chrome/browser/gears_integration.h" | 21 #include "chrome/browser/gears_integration.h" |
22 #include "chrome/browser/google_util.h" | 22 #include "chrome/browser/google_util.h" |
23 #include "chrome/browser/js_before_unload_handler.h" | |
24 #include "chrome/browser/jsmessage_box_handler.h" | 23 #include "chrome/browser/jsmessage_box_handler.h" |
25 #include "chrome/browser/load_from_memory_cache_details.h" | 24 #include "chrome/browser/load_from_memory_cache_details.h" |
26 #include "chrome/browser/load_notification_details.h" | 25 #include "chrome/browser/load_notification_details.h" |
27 #include "chrome/browser/password_manager/password_manager.h" | 26 #include "chrome/browser/password_manager/password_manager.h" |
28 #include "chrome/browser/plugin_installer.h" | 27 #include "chrome/browser/plugin_installer.h" |
29 #include "chrome/browser/profile.h" | 28 #include "chrome/browser/profile.h" |
30 #include "chrome/browser/renderer_host/render_process_host.h" | 29 #include "chrome/browser/renderer_host/render_process_host.h" |
31 #include "chrome/browser/renderer_host/render_view_host.h" | 30 #include "chrome/browser/renderer_host/render_view_host.h" |
32 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 31 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
33 #include "chrome/browser/renderer_host/web_cache_manager.h" | 32 #include "chrome/browser/renderer_host/web_cache_manager.h" |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 | 1186 |
1188 RunJavascriptMessageBox(this, frame_url, flags, message, default_prompt, | 1187 RunJavascriptMessageBox(this, frame_url, flags, message, default_prompt, |
1189 show_suppress_checkbox, reply_msg); | 1188 show_suppress_checkbox, reply_msg); |
1190 } else { | 1189 } else { |
1191 // If we are suppressing messages, just reply as is if the user immediately | 1190 // If we are suppressing messages, just reply as is if the user immediately |
1192 // pressed "Cancel". | 1191 // pressed "Cancel". |
1193 OnJavaScriptMessageBoxClosed(reply_msg, false, std::wstring()); | 1192 OnJavaScriptMessageBoxClosed(reply_msg, false, std::wstring()); |
1194 } | 1193 } |
1195 } | 1194 } |
1196 | 1195 |
1197 void WebContents::RunBeforeUnloadConfirm(const GURL& frame_url, | 1196 void WebContents::RunBeforeUnloadConfirm(const std::wstring& message, |
1198 const std::wstring& message, | |
1199 IPC::Message* reply_msg) { | 1197 IPC::Message* reply_msg) { |
1200 RunBeforeUnloadDialog(this, frame_url, message, reply_msg); | 1198 RunBeforeUnloadDialog(this, message, reply_msg); |
1201 } | 1199 } |
1202 | 1200 |
1203 void WebContents::ShowModalHTMLDialog(const GURL& url, int width, int height, | 1201 void WebContents::ShowModalHTMLDialog(const GURL& url, int width, int height, |
1204 const std::string& json_arguments, | 1202 const std::string& json_arguments, |
1205 IPC::Message* reply_msg) { | 1203 IPC::Message* reply_msg) { |
1206 if (delegate()) { | 1204 if (delegate()) { |
1207 HtmlDialogUIDelegate* dialog_delegate = | 1205 HtmlDialogUIDelegate* dialog_delegate = |
1208 new ModalHtmlDialogDelegate(url, width, height, json_arguments, | 1206 new ModalHtmlDialogDelegate(url, width, height, json_arguments, |
1209 reply_msg, this); | 1207 reply_msg, this); |
1210 delegate()->ShowHtmlDialog(dialog_delegate, NULL); | 1208 delegate()->ShowHtmlDialog(dialog_delegate, NULL); |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 // -> Use pending DOM UI if any. | 2032 // -> Use pending DOM UI if any. |
2035 // | 2033 // |
2036 // - Normal state with no load: committed nav entry + no pending nav entry: | 2034 // - Normal state with no load: committed nav entry + no pending nav entry: |
2037 // -> Use committed DOM UI. | 2035 // -> Use committed DOM UI. |
2038 if (controller()->GetPendingEntry() && | 2036 if (controller()->GetPendingEntry() && |
2039 (controller()->GetLastCommittedEntry() || | 2037 (controller()->GetLastCommittedEntry() || |
2040 render_manager_.pending_dom_ui())) | 2038 render_manager_.pending_dom_ui())) |
2041 return render_manager_.pending_dom_ui(); | 2039 return render_manager_.pending_dom_ui(); |
2042 return render_manager_.dom_ui(); | 2040 return render_manager_.dom_ui(); |
2043 } | 2041 } |
OLD | NEW |