| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BROWSER_PRINTING_PRINTED_DOCUMENT_H__ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__ |
| 6 #define CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__ | 6 #define CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // Draws the page in the context. If the page is not available right now, it | 56 // Draws the page in the context. If the page is not available right now, it |
| 57 // requests to have this page be rendered and returns false. | 57 // requests to have this page be rendered and returns false. |
| 58 // Note: locks for a short amount of time. | 58 // Note: locks for a short amount of time. |
| 59 bool RenderPrintedPageNumber(int page_number, HDC context); | 59 bool RenderPrintedPageNumber(int page_number, HDC context); |
| 60 | 60 |
| 61 // Returns true if all the necessary pages for the settings are already | 61 // Returns true if all the necessary pages for the settings are already |
| 62 // rendered. | 62 // rendered. |
| 63 // Note: locks while parsing the whole tree. | 63 // Note: locks while parsing the whole tree. |
| 64 bool IsComplete() const; | 64 bool IsComplete() const; |
| 65 | 65 |
| 66 // Requests all the missing pages. Returns true if at least one page has been | |
| 67 // requested. Returns false if there was not enough information to request the | |
| 68 // missing pages, i.e. document_page_count_ is not initialized or no page has | |
| 69 // been requested. | |
| 70 // Note: locks while parsing the whole tree. | |
| 71 bool RequestMissingPages(); | |
| 72 | |
| 73 // Disconnects the PrintedPage source (PrintedPagesSource). It is done when | 66 // Disconnects the PrintedPage source (PrintedPagesSource). It is done when |
| 74 // the source is being destroyed. | 67 // the source is being destroyed. |
| 75 void DisconnectSource(); | 68 void DisconnectSource(); |
| 76 | 69 |
| 77 // Retrieves the current memory usage of the renderer pages. | 70 // Retrieves the current memory usage of the renderer pages. |
| 78 // Note: locks for a short amount of time. | 71 // Note: locks for a short amount of time. |
| 79 size_t MemoryUsage() const; | 72 size_t MemoryUsage() const; |
| 80 | 73 |
| 81 // Sets the number of pages in the document to be rendered. Can only be set | 74 // Sets the number of pages in the document to be rendered. Can only be set |
| 82 // once. | 75 // once. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 }; | 159 }; |
| 167 | 160 |
| 168 // Prints the headers and footers for one page in the specified context | 161 // Prints the headers and footers for one page in the specified context |
| 169 // according to the current settings. | 162 // according to the current settings. |
| 170 void PrintHeaderFooter(HDC context, | 163 void PrintHeaderFooter(HDC context, |
| 171 const PrintedPage& page, | 164 const PrintedPage& page, |
| 172 PageOverlays::HorizontalPosition x, | 165 PageOverlays::HorizontalPosition x, |
| 173 PageOverlays::VerticalPosition y, | 166 PageOverlays::VerticalPosition y, |
| 174 const gfx::Font& font) const; | 167 const gfx::Font& font) const; |
| 175 | 168 |
| 176 // Calls the render source to render a page. Makes sure to execute the call in | |
| 177 // the right thread context. | |
| 178 void PrintPage_ThreadJump(int page_number); | |
| 179 | |
| 180 // All writable data member access must be guarded by this lock. Needs to be | 169 // All writable data member access must be guarded by this lock. Needs to be |
| 181 // mutable since it can be acquired from const member functions. | 170 // mutable since it can be acquired from const member functions. |
| 182 mutable Lock lock_; | 171 mutable Lock lock_; |
| 183 | 172 |
| 184 // All the mutable members. | 173 // All the mutable members. |
| 185 Mutable mutable_; | 174 Mutable mutable_; |
| 186 | 175 |
| 187 // All the immutable members. | 176 // All the immutable members. |
| 188 const Immutable immutable_; | 177 const Immutable immutable_; |
| 189 | 178 |
| 190 DISALLOW_EVIL_CONSTRUCTORS(PrintedDocument); | 179 DISALLOW_EVIL_CONSTRUCTORS(PrintedDocument); |
| 191 }; | 180 }; |
| 192 | 181 |
| 193 } // namespace printing | 182 } // namespace printing |
| 194 | 183 |
| 195 #endif // CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__ | 184 #endif // CHROME_BROWSER_PRINTING_PRINTED_DOCUMENT_H__ |
| OLD | NEW |