summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 04:30:30 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 04:30:30 +0000
commit1b9af295f86b846582f96277bdba05d98bc3d2f4 (patch)
tree1241b0a0dfbdac3d6b941198068b8c9f8d30c5d9 /chrome/renderer
parent3222e481e8bd6e542419d6d97ae26382f571e71d (diff)
downloadchromium_src-1b9af295f86b846582f96277bdba05d98bc3d2f4.zip
chromium_src-1b9af295f86b846582f96277bdba05d98bc3d2f4.tar.gz
chromium_src-1b9af295f86b846582f96277bdba05d98bc3d2f4.tar.bz2
Windowed plugins like Flash would cause the hung plugin dialog to show up when the print dialog was displayed.
The proposed fix is to signal the modal dialog event which would ensure that the renderer and plugins both pump messages when the print dialog is displayed. This fixes http://code.google.com/p/chromium/issues/detail?id=13804 Bug=13804 Review URL: http://codereview.chromium.org/155133 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20243 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/mock_render_thread.cc14
-rw-r--r--chrome/renderer/mock_render_thread.h6
-rw-r--r--chrome/renderer/print_web_view_helper.cc20
3 files changed, 23 insertions, 17 deletions
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index a9df6fd..3494b12 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -114,15 +114,13 @@ void MockRenderThread::OnGetDefaultPrintSettings(ViewMsg_Print_Params* params) {
printer_->GetDefaultPrintSettings(params);
}
-void MockRenderThread::OnScriptedPrint(gfx::NativeViewId host_window,
- int cookie,
- int expected_pages_count,
- bool has_selection,
- ViewMsg_PrintPages_Params* settings) {
+void MockRenderThread::OnScriptedPrint(
+ const ViewHostMsg_ScriptedPrint_Params& params,
+ ViewMsg_PrintPages_Params* settings) {
if (printer_.get()) {
- printer_->ScriptedPrint(cookie,
- expected_pages_count,
- has_selection,
+ printer_->ScriptedPrint(params.cookie,
+ params.expected_pages_count,
+ params.has_selection,
settings);
}
}
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h
index 75ca5d3..1921fb1 100644
--- a/chrome/renderer/mock_render_thread.h
+++ b/chrome/renderer/mock_render_thread.h
@@ -14,6 +14,7 @@
struct ViewMsg_Print_Params;
struct ViewMsg_PrintPages_Params;
+struct ViewHostMsg_ScriptedPrint_Params;
// This class is very simple mock of RenderThread. It simulates an IPC channel
// which supports only two messages:
@@ -89,10 +90,7 @@ class MockRenderThread : public RenderThreadBase {
void OnGetDefaultPrintSettings(ViewMsg_Print_Params* setting);
// The RenderView expects final print settings from the user.
- void OnScriptedPrint(gfx::NativeViewId host_window,
- int cookie,
- int expected_pages_count,
- bool has_selection,
+ void OnScriptedPrint(const ViewHostMsg_ScriptedPrint_Params& params,
ViewMsg_PrintPages_Params* settings);
void OnDidGetPrintedPagesCount(int cookie, int number_pages);
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 966a9e0..aac98ac 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -157,15 +157,25 @@ void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) {
// Ask the browser to show UI to retrieve the final print settings.
ViewMsg_PrintPages_Params print_settings;
+
+ ViewHostMsg_ScriptedPrint_Params params;
+
+ // The routing id is sent across as it is needed to look up the
+ // corresponding RenderViewHost instance to signal and reset the
+ // pump messages event.
+ params.routing_id = routing_id();
// host_window_ may be NULL at this point if the current window is a popup
// and the print() command has been issued from the parent. The receiver
// of this message has to deal with this.
- msg = new ViewHostMsg_ScriptedPrint(routing_id(),
- render_view_->host_window(),
- default_settings.document_cookie,
- expected_pages_count,
- frame->HasSelection(),
+ params.host_window_id = render_view_->host_window();
+ params.cookie = default_settings.document_cookie;
+ params.has_selection = frame->HasSelection();
+ params.expected_pages_count = expected_pages_count;
+
+ msg = new ViewHostMsg_ScriptedPrint(params,
&print_settings);
+ msg->set_pump_messages_event(render_view_->modal_dialog_event());
+
if (Send(msg)) {
msg = NULL;