| Index: components/printing/test/mock_printer.cc
|
| diff --git a/components/printing/test/mock_printer.cc b/components/printing/test/mock_printer.cc
|
| index 4197dc603b584709e98e3d2d92c279e943983473..1a38b7a08aa8033e1ae3bd0a71d87c07e8cb3d4e 100644
|
| --- a/components/printing/test/mock_printer.cc
|
| +++ b/components/printing/test/mock_printer.cc
|
| @@ -38,6 +38,13 @@
|
| params->margin_left = static_cast<int>(0.30 * dpi);
|
| params->margin_top = static_cast<int>(0.30 * dpi);
|
| }
|
| +}
|
| +
|
| +void UpdatePageSizeAndScaling(const gfx::Size& page_size,
|
| + int scale_factor,
|
| + PrintMsg_Print_Params* params) {
|
| + params->page_size = page_size;
|
| + params->scale_factor = static_cast<double>(scale_factor) / 100.0;
|
| }
|
|
|
| } // namespace
|
| @@ -161,7 +168,9 @@
|
| void MockPrinter::UpdateSettings(int cookie,
|
| PrintMsg_PrintPages_Params* params,
|
| const std::vector<int>& pages,
|
| - int margins_type) {
|
| + int margins_type,
|
| + const gfx::Size& page_size,
|
| + int scale_factor) {
|
| if (document_cookie_ == -1) {
|
| document_cookie_ = CreateDocumentCookie();
|
| }
|
| @@ -169,6 +178,8 @@
|
| params->pages = pages;
|
| SetPrintParams(&(params->params));
|
| UpdateMargins(margins_type, dpi_, &(params->params));
|
| + if (!page_size.IsEmpty())
|
| + UpdatePageSizeAndScaling(page_size, scale_factor, ¶ms->params);
|
| printer_status_ = PRINTER_PRINTING;
|
| }
|
|
|
|
|