| 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_PRINT_VIEW_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "chrome/browser/printing/printed_pages_source.h" | 9 #include "chrome/browser/printing/printed_pages_source.h" |
| 10 #include "chrome/common/notification_registrar.h" | 10 #include "chrome/common/notification_registrar.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Creates a new empty print job. It has no settings loaded. If there is | 70 // Creates a new empty print job. It has no settings loaded. If there is |
| 71 // currently a print job, safely disconnect from it. Returns false if it is | 71 // currently a print job, safely disconnect from it. Returns false if it is |
| 72 // impossible to safely disconnect from the current print job or it is | 72 // impossible to safely disconnect from the current print job or it is |
| 73 // impossible to create a new print job. | 73 // impossible to create a new print job. |
| 74 bool CreateNewPrintJob(PrintJobWorkerOwner* job); | 74 bool CreateNewPrintJob(PrintJobWorkerOwner* job); |
| 75 | 75 |
| 76 // Makes sure the current print_job_ has all its data before continuing, and | 76 // Makes sure the current print_job_ has all its data before continuing, and |
| 77 // disconnect from it. | 77 // disconnect from it. |
| 78 void DisconnectFromCurrentPrintJob(); | 78 void DisconnectFromCurrentPrintJob(); |
| 79 | 79 |
| 80 // Notify that the printing is done. |
| 81 void PrintingDone(bool success); |
| 82 |
| 80 // Terminates the print job. Noop if no print job has been created. If | 83 // Terminates the print job. Noop if no print job has been created. If |
| 81 // |cancel| is true, cancel it instead of waiting for the job to finish. Will | 84 // |cancel| is true, cancel it instead of waiting for the job to finish. Will |
| 82 // call ReleasePrintJob(). | 85 // call ReleasePrintJob(). |
| 83 void TerminatePrintJob(bool cancel); | 86 void TerminatePrintJob(bool cancel); |
| 84 | 87 |
| 85 // Releases print_job_. Correctly deregisters from notifications. Noop if | 88 // Releases print_job_. Correctly deregisters from notifications. Noop if |
| 86 // no print job has been created. | 89 // no print job has been created. |
| 87 void ReleasePrintJob(); | 90 void ReleasePrintJob(); |
| 88 | 91 |
| 89 // Prints the document. Starts the actual print job. Requests asynchronously | 92 // Prints the document. Starts the actual print job. Requests asynchronously |
| (...skipping 16 matching lines...) Expand all Loading... |
| 106 NotificationRegistrar registrar_; | 109 NotificationRegistrar registrar_; |
| 107 | 110 |
| 108 // Manages the low-level talk to the printer. | 111 // Manages the low-level talk to the printer. |
| 109 scoped_refptr<PrintJob> print_job_; | 112 scoped_refptr<PrintJob> print_job_; |
| 110 | 113 |
| 111 // Waiting for print_job_ initialization to be completed to start printing. | 114 // Waiting for print_job_ initialization to be completed to start printing. |
| 112 // Specifically the DEFAULT_INIT_DONE notification. Set when PrintNow() is | 115 // Specifically the DEFAULT_INIT_DONE notification. Set when PrintNow() is |
| 113 // called. | 116 // called. |
| 114 bool waiting_to_print_; | 117 bool waiting_to_print_; |
| 115 | 118 |
| 119 // Indication of success of the print job. |
| 120 bool printing_succeeded_; |
| 121 |
| 116 // Running an inner message loop inside RenderAllMissingPagesNow(). This means | 122 // Running an inner message loop inside RenderAllMissingPagesNow(). This means |
| 117 // we are _blocking_ until all the necessary pages have been rendered or the | 123 // we are _blocking_ until all the necessary pages have been rendered or the |
| 118 // print settings are being loaded. | 124 // print settings are being loaded. |
| 119 bool inside_inner_message_loop_; | 125 bool inside_inner_message_loop_; |
| 120 | 126 |
| 121 // PrintViewManager is created as an extension of WebContent specialized for | 127 // PrintViewManager is created as an extension of WebContent specialized for |
| 122 // printing-related behavior. Still, access to the renderer is needed so a | 128 // printing-related behavior. Still, access to the renderer is needed so a |
| 123 // back reference is kept the the "parent object". | 129 // back reference is kept the the "parent object". |
| 124 TabContents& owner_; | 130 TabContents& owner_; |
| 125 | 131 |
| 126 DISALLOW_COPY_AND_ASSIGN(PrintViewManager); | 132 DISALLOW_COPY_AND_ASSIGN(PrintViewManager); |
| 127 }; | 133 }; |
| 128 | 134 |
| 129 } // namespace printing | 135 } // namespace printing |
| 130 | 136 |
| 131 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ | 137 #endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_H_ |
| OLD | NEW |