| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PRINT_VIEW_MANAGER_BASE_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/prefs/pref_member.h" | 9 #include "base/prefs/pref_member.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 bool RunInnerMessageLoop(); | 124 bool RunInnerMessageLoop(); |
| 125 | 125 |
| 126 // In the case of Scripted Printing, where the renderer is controlling the | 126 // In the case of Scripted Printing, where the renderer is controlling the |
| 127 // control flow, print_job_ is initialized whenever possible. No-op is | 127 // control flow, print_job_ is initialized whenever possible. No-op is |
| 128 // print_job_ is initialized. | 128 // print_job_ is initialized. |
| 129 bool OpportunisticallyCreatePrintJob(int cookie); | 129 bool OpportunisticallyCreatePrintJob(int cookie); |
| 130 | 130 |
| 131 // Release the PrinterQuery associated with our |cookie_|. | 131 // Release the PrinterQuery associated with our |cookie_|. |
| 132 void ReleasePrinterQuery(); | 132 void ReleasePrinterQuery(); |
| 133 | 133 |
| 134 #if defined(WIN_PDF_METAFILE_FOR_PRINTING) | 134 #if defined(OS_WIN) |
| 135 // Called on completion of converting the pdf to emf. | 135 // Called on completion of converting the pdf to emf. |
| 136 void OnPdfToEmfConverted(const PrintHostMsg_DidPrintPage_Params& params, | 136 void OnPdfToEmfConverted(const PrintHostMsg_DidPrintPage_Params& params, |
| 137 double scale_factor, | 137 double scale_factor, |
| 138 const std::vector<base::FilePath>& emf_file); | 138 const std::vector<base::FilePath>& emf_file); |
| 139 #endif | 139 #endif // OS_WIN |
| 140 | 140 |
| 141 content::NotificationRegistrar registrar_; | 141 content::NotificationRegistrar registrar_; |
| 142 | 142 |
| 143 // Manages the low-level talk to the printer. | 143 // Manages the low-level talk to the printer. |
| 144 scoped_refptr<PrintJob> print_job_; | 144 scoped_refptr<PrintJob> print_job_; |
| 145 | 145 |
| 146 // Number of pages to print in the print job. | 146 // Number of pages to print in the print job. |
| 147 int number_pages_; | 147 int number_pages_; |
| 148 | 148 |
| 149 // Indication of success of the print job. | 149 // Indication of success of the print job. |
| 150 bool printing_succeeded_; | 150 bool printing_succeeded_; |
| 151 | 151 |
| 152 // Running an inner message loop inside RenderAllMissingPagesNow(). This means | 152 // Running an inner message loop inside RenderAllMissingPagesNow(). This means |
| 153 // we are _blocking_ until all the necessary pages have been rendered or the | 153 // we are _blocking_ until all the necessary pages have been rendered or the |
| 154 // print settings are being loaded. | 154 // print settings are being loaded. |
| 155 bool inside_inner_message_loop_; | 155 bool inside_inner_message_loop_; |
| 156 | 156 |
| 157 #if (defined(OS_POSIX) && !defined(OS_MACOSX)) || \ | 157 #if !defined(OS_MACOSX) |
| 158 defined(WIN_PDF_METAFILE_FOR_PRINTING) | |
| 159 // Set to true when OnDidPrintPage() should be expecting the first page. | 158 // Set to true when OnDidPrintPage() should be expecting the first page. |
| 160 bool expecting_first_page_; | 159 bool expecting_first_page_; |
| 161 #endif | 160 #endif // OS_MACOSX |
| 162 | 161 |
| 163 #if defined(WIN_PDF_METAFILE_FOR_PRINTING) | 162 #if defined(OS_WIN) |
| 164 scoped_ptr<PdfToEmfConverter> pdf_to_emf_converter_; | 163 scoped_ptr<PdfToEmfConverter> pdf_to_emf_converter_; |
| 165 #endif | 164 #endif // OS_WIN |
| 166 | 165 |
| 167 // The document cookie of the current PrinterQuery. | 166 // The document cookie of the current PrinterQuery. |
| 168 int cookie_; | 167 int cookie_; |
| 169 | 168 |
| 170 // Whether printing is enabled. | 169 // Whether printing is enabled. |
| 171 BooleanPrefMember printing_enabled_; | 170 BooleanPrefMember printing_enabled_; |
| 172 | 171 |
| 173 scoped_refptr<printing::PrintQueriesQueue> queue_; | 172 scoped_refptr<printing::PrintQueriesQueue> queue_; |
| 174 | 173 |
| 175 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); | 174 DISALLOW_COPY_AND_ASSIGN(PrintViewManagerBase); |
| 176 }; | 175 }; |
| 177 | 176 |
| 178 } // namespace printing | 177 } // namespace printing |
| 179 | 178 |
| 180 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ | 179 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_BASE_H_ |
| OLD | NEW |