| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <fcntl.h> | 7 #include <fcntl.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 void MockRenderThread::OnDidPrintPage( | 208 void MockRenderThread::OnDidPrintPage( |
| 209 const PrintHostMsg_DidPrintPage_Params& params) { | 209 const PrintHostMsg_DidPrintPage_Params& params) { |
| 210 if (printer_.get()) | 210 if (printer_.get()) |
| 211 printer_->PrintPage(params); | 211 printer_->PrintPage(params); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void MockRenderThread::OnDidGetPreviewPageCount(int document_cookie, | 214 void MockRenderThread::OnDidGetPreviewPageCount(int document_cookie, |
| 215 int number_pages, | 215 int number_pages, |
| 216 bool is_modifiable) { | 216 bool is_modifiable, |
| 217 bool clear_preview_data) { |
| 217 print_preview_pages_remaining_ = number_pages; | 218 print_preview_pages_remaining_ = number_pages; |
| 218 } | 219 } |
| 219 | 220 |
| 220 void MockRenderThread::OnDidPreviewPage( | 221 void MockRenderThread::OnDidPreviewPage( |
| 221 const PrintHostMsg_DidPreviewPage_Params& params) { | 222 const PrintHostMsg_DidPreviewPage_Params& params) { |
| 222 if (params.page_number < printing::FIRST_PAGE_INDEX) | 223 if (params.page_number < printing::FIRST_PAGE_INDEX) |
| 223 return; | 224 return; |
| 224 print_preview_pages_remaining_--; | 225 print_preview_pages_remaining_--; |
| 225 } | 226 } |
| 226 | 227 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 246 printer_->UpdateSettings(document_cookie, params); | 247 printer_->UpdateSettings(document_cookie, params); |
| 247 } | 248 } |
| 248 | 249 |
| 249 void MockRenderThread::set_print_dialog_user_response(bool response) { | 250 void MockRenderThread::set_print_dialog_user_response(bool response) { |
| 250 print_dialog_user_response_ = response; | 251 print_dialog_user_response_ = response; |
| 251 } | 252 } |
| 252 | 253 |
| 253 int MockRenderThread::print_preview_pages_remaining() { | 254 int MockRenderThread::print_preview_pages_remaining() { |
| 254 return print_preview_pages_remaining_; | 255 return print_preview_pages_remaining_; |
| 255 } | 256 } |
| OLD | NEW |