| 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/renderer/mock_render_thread.h" | 5 #include "chrome/renderer/mock_render_thread.h" |
| 6 | 6 |
| 7 #include "chrome/common/ipc_message_utils.h" | 7 #include "chrome/common/ipc_message_utils.h" |
| 8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // We don't have to duplicate the input handles since RenderViewTest does not | 107 // We don't have to duplicate the input handles since RenderViewTest does not |
| 108 // separate a browser process from a renderer process. | 108 // separate a browser process from a renderer process. |
| 109 *browser_handle = renderer_handle; | 109 *browser_handle = renderer_handle; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void MockRenderThread::OnGetDefaultPrintSettings(ViewMsg_Print_Params* params) { | 112 void MockRenderThread::OnGetDefaultPrintSettings(ViewMsg_Print_Params* params) { |
| 113 if (printer_.get()) | 113 if (printer_.get()) |
| 114 printer_->GetDefaultPrintSettings(params); | 114 printer_->GetDefaultPrintSettings(params); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void MockRenderThread::OnScriptedPrint(gfx::NativeViewId host_window, | 117 void MockRenderThread::OnScriptedPrint( |
| 118 int cookie, | 118 const ViewHostMsg_ScriptedPrint_Params& params, |
| 119 int expected_pages_count, | 119 ViewMsg_PrintPages_Params* settings) { |
| 120 bool has_selection, | |
| 121 ViewMsg_PrintPages_Params* settings) { | |
| 122 if (printer_.get()) { | 120 if (printer_.get()) { |
| 123 printer_->ScriptedPrint(cookie, | 121 printer_->ScriptedPrint(params.cookie, |
| 124 expected_pages_count, | 122 params.expected_pages_count, |
| 125 has_selection, | 123 params.has_selection, |
| 126 settings); | 124 settings); |
| 127 } | 125 } |
| 128 } | 126 } |
| 129 | 127 |
| 130 void MockRenderThread::OnDidGetPrintedPagesCount(int cookie, int number_pages) { | 128 void MockRenderThread::OnDidGetPrintedPagesCount(int cookie, int number_pages) { |
| 131 if (printer_.get()) | 129 if (printer_.get()) |
| 132 printer_->SetPrintedPagesCount(cookie, number_pages); | 130 printer_->SetPrintedPagesCount(cookie, number_pages); |
| 133 } | 131 } |
| 134 | 132 |
| 135 void MockRenderThread::OnDidPrintPage( | 133 void MockRenderThread::OnDidPrintPage( |
| 136 const ViewHostMsg_DidPrintPage_Params& params) { | 134 const ViewHostMsg_DidPrintPage_Params& params) { |
| 137 if (printer_.get()) | 135 if (printer_.get()) |
| 138 printer_->PrintPage(params); | 136 printer_->PrintPage(params); |
| 139 } | 137 } |
| OLD | NEW |