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_printer.h" | 5 #include "chrome/renderer/mock_printer.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| 11 #include "chrome/common/render_messages_params.h" |
11 #include "ipc/ipc_message_utils.h" | 12 #include "ipc/ipc_message_utils.h" |
12 #include "printing/units.h" | 13 #include "printing/units.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 MockPrinter::MockPrinter() | 16 MockPrinter::MockPrinter() |
16 : printable_width_(0), | 17 : printable_width_(0), |
17 printable_height_(0), | 18 printable_height_(0), |
18 dpi_(printing::kPointsPerInch), | 19 dpi_(printing::kPointsPerInch), |
19 max_shrink_(2.0), | 20 max_shrink_(2.0), |
20 min_shrink_(1.25), | 21 min_shrink_(1.25), |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (printer_status_ != PRINTER_READY || page >= pages_.size()) | 190 if (printer_status_ != PRINTER_READY || page >= pages_.size()) |
190 return false; | 191 return false; |
191 | 192 |
192 pages_[page]->image().SaveToPng(filepath); | 193 pages_[page]->image().SaveToPng(filepath); |
193 return true; | 194 return true; |
194 } | 195 } |
195 | 196 |
196 int MockPrinter::CreateDocumentCookie() { | 197 int MockPrinter::CreateDocumentCookie() { |
197 return ++current_document_cookie_; | 198 return ++current_document_cookie_; |
198 } | 199 } |
OLD | NEW |