| 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 #ifndef CHROME_RENDERER_MOCK_PRINTER_H_ | 5 #ifndef CHROME_RENDERER_MOCK_PRINTER_H_ |
| 6 #define CHROME_RENDERER_MOCK_PRINTER_H_ | 6 #define CHROME_RENDERER_MOCK_PRINTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // Get a pointer to the printed page, returns NULL if pageno has not been | 93 // Get a pointer to the printed page, returns NULL if pageno has not been |
| 94 // printed. The pointer is for read only view and should not be deleted. | 94 // printed. The pointer is for read only view and should not be deleted. |
| 95 const MockPrinterPage* GetPrintedPage(unsigned int pageno) const; | 95 const MockPrinterPage* GetPrintedPage(unsigned int pageno) const; |
| 96 | 96 |
| 97 int GetWidth(unsigned int page) const; | 97 int GetWidth(unsigned int page) const; |
| 98 int GetHeight(unsigned int page) const; | 98 int GetHeight(unsigned int page) const; |
| 99 bool GetBitmapChecksum(unsigned int page, std::string* checksum) const; | 99 bool GetBitmapChecksum(unsigned int page, std::string* checksum) const; |
| 100 bool GetSource(unsigned int page, const void** data, uint32* size) const; | 100 bool GetSource(unsigned int page, const void** data, uint32* size) const; |
| 101 bool GetBitmap(unsigned int page, const void** data, uint32* size) const; | 101 bool GetBitmap(unsigned int page, const void** data, uint32* size) const; |
| 102 bool SaveSource(unsigned int page, const FilePath& filepath) const; | 102 bool SaveSource(unsigned int page, const base::FilePath& filepath) const; |
| 103 bool SaveBitmap(unsigned int page, const FilePath& filepath) const; | 103 bool SaveBitmap(unsigned int page, const base::FilePath& filepath) const; |
| 104 | 104 |
| 105 protected: | 105 protected: |
| 106 int CreateDocumentCookie(); | 106 int CreateDocumentCookie(); |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 // Helper function to fill the fields in |params|. | 109 // Helper function to fill the fields in |params|. |
| 110 void SetPrintParams(PrintMsg_Print_Params* params); | 110 void SetPrintParams(PrintMsg_Print_Params* params); |
| 111 | 111 |
| 112 // In pixels according to dpi_x and dpi_y. | 112 // In pixels according to dpi_x and dpi_y. |
| 113 gfx::Size page_size_; | 113 gfx::Size page_size_; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 // Used for generating invalid settings. | 159 // Used for generating invalid settings. |
| 160 bool use_invalid_settings_; | 160 bool use_invalid_settings_; |
| 161 | 161 |
| 162 std::vector<scoped_refptr<MockPrinterPage> > pages_; | 162 std::vector<scoped_refptr<MockPrinterPage> > pages_; |
| 163 | 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(MockPrinter); | 164 DISALLOW_COPY_AND_ASSIGN(MockPrinter); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ | 167 #endif // CHROME_RENDERER_MOCK_PRINTER_H_ |
| OLD | NEW |