| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_printer.h" | 5 #include "chrome/renderer/mock_printer.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 desired_dpi_(printing::kPointsPerInch), | 58 desired_dpi_(printing::kPointsPerInch), |
| 59 selection_only_(false), | 59 selection_only_(false), |
| 60 document_cookie_(-1), | 60 document_cookie_(-1), |
| 61 current_document_cookie_(0), | 61 current_document_cookie_(0), |
| 62 printer_status_(PRINTER_READY), | 62 printer_status_(PRINTER_READY), |
| 63 number_pages_(0), | 63 number_pages_(0), |
| 64 page_number_(0), | 64 page_number_(0), |
| 65 is_first_request_(true), | 65 is_first_request_(true), |
| 66 print_to_pdf_(false), | 66 print_to_pdf_(false), |
| 67 preview_request_id_(0), | 67 preview_request_id_(0), |
| 68 fit_to_paper_size_(true), | 68 print_scaling_option_(WebKit::WebPrintScalingOptionSourceSize), |
| 69 display_header_footer_(false), | 69 display_header_footer_(false), |
| 70 date_(ASCIIToUTF16("date")), | 70 date_(ASCIIToUTF16("date")), |
| 71 title_(ASCIIToUTF16("title")), | 71 title_(ASCIIToUTF16("title")), |
| 72 url_(ASCIIToUTF16("url")), | 72 url_(ASCIIToUTF16("url")), |
| 73 use_invalid_settings_(false) { | 73 use_invalid_settings_(false) { |
| 74 page_size_.SetSize(static_cast<int>(8.5 * dpi_), | 74 page_size_.SetSize(static_cast<int>(8.5 * dpi_), |
| 75 static_cast<int>(11.0 * dpi_)); | 75 static_cast<int>(11.0 * dpi_)); |
| 76 content_size_.SetSize(static_cast<int>((7.5 * dpi_)), | 76 content_size_.SetSize(static_cast<int>((7.5 * dpi_)), |
| 77 static_cast<int>((10.0 * dpi_))); | 77 static_cast<int>((10.0 * dpi_))); |
| 78 margin_left_ = margin_top_ = static_cast<int>(0.5 * dpi_); | 78 margin_left_ = margin_top_ = static_cast<int>(0.5 * dpi_); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 settings->params.dpi = dpi_; | 144 settings->params.dpi = dpi_; |
| 145 settings->params.max_shrink = max_shrink_; | 145 settings->params.max_shrink = max_shrink_; |
| 146 settings->params.min_shrink = min_shrink_; | 146 settings->params.min_shrink = min_shrink_; |
| 147 settings->params.desired_dpi = desired_dpi_; | 147 settings->params.desired_dpi = desired_dpi_; |
| 148 settings->params.selection_only = selection_only_; | 148 settings->params.selection_only = selection_only_; |
| 149 settings->params.document_cookie = document_cookie_; | 149 settings->params.document_cookie = document_cookie_; |
| 150 settings->params.page_size = page_size_; | 150 settings->params.page_size = page_size_; |
| 151 settings->params.content_size = content_size_; | 151 settings->params.content_size = content_size_; |
| 152 settings->params.printable_area = printable_area_; | 152 settings->params.printable_area = printable_area_; |
| 153 settings->params.is_first_request = is_first_request_; | 153 settings->params.is_first_request = is_first_request_; |
| 154 settings->params.fit_to_paper_size = fit_to_paper_size_; | 154 settings->params.print_scaling_option = print_scaling_option_; |
| 155 settings->params.print_to_pdf = print_to_pdf_; | 155 settings->params.print_to_pdf = print_to_pdf_; |
| 156 settings->params.preview_request_id = preview_request_id_; | 156 settings->params.preview_request_id = preview_request_id_; |
| 157 settings->params.display_header_footer = display_header_footer_; | 157 settings->params.display_header_footer = display_header_footer_; |
| 158 settings->params.date = date_; | 158 settings->params.date = date_; |
| 159 settings->params.title = title_; | 159 settings->params.title = title_; |
| 160 settings->params.url = url_; | 160 settings->params.url = url_; |
| 161 printer_status_ = PRINTER_PRINTING; | 161 printer_status_ = PRINTER_PRINTING; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void MockPrinter::UpdateSettings(int cookie, | 164 void MockPrinter::UpdateSettings(int cookie, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 params->min_shrink = min_shrink_; | 298 params->min_shrink = min_shrink_; |
| 299 params->desired_dpi = desired_dpi_; | 299 params->desired_dpi = desired_dpi_; |
| 300 params->selection_only = selection_only_; | 300 params->selection_only = selection_only_; |
| 301 params->document_cookie = document_cookie_; | 301 params->document_cookie = document_cookie_; |
| 302 params->page_size = page_size_; | 302 params->page_size = page_size_; |
| 303 params->content_size = content_size_; | 303 params->content_size = content_size_; |
| 304 params->printable_area = printable_area_; | 304 params->printable_area = printable_area_; |
| 305 params->margin_left = margin_left_; | 305 params->margin_left = margin_left_; |
| 306 params->margin_top = margin_top_; | 306 params->margin_top = margin_top_; |
| 307 params->is_first_request = is_first_request_; | 307 params->is_first_request = is_first_request_; |
| 308 params->fit_to_paper_size = fit_to_paper_size_; | 308 params->print_scaling_option = print_scaling_option_; |
| 309 params->print_to_pdf = print_to_pdf_; | 309 params->print_to_pdf = print_to_pdf_; |
| 310 params->preview_request_id = preview_request_id_; | 310 params->preview_request_id = preview_request_id_; |
| 311 params->display_header_footer = display_header_footer_; | 311 params->display_header_footer = display_header_footer_; |
| 312 params->date = date_; | 312 params->date = date_; |
| 313 params->title = title_; | 313 params->title = title_; |
| 314 params->url = url_; | 314 params->url = url_; |
| 315 } | 315 } |
| OLD | NEW |