| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_JOB_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 bool FlushJob(int timeout_ms); | 81 bool FlushJob(int timeout_ms); |
| 82 | 82 |
| 83 // Disconnects the PrintedPage source (PrintedPagesSource). It is done when | 83 // Disconnects the PrintedPage source (PrintedPagesSource). It is done when |
| 84 // the source is being destroyed. | 84 // the source is being destroyed. |
| 85 void DisconnectSource(); | 85 void DisconnectSource(); |
| 86 | 86 |
| 87 // Returns true if the print job is pending, i.e. between a StartPrinting() | 87 // Returns true if the print job is pending, i.e. between a StartPrinting() |
| 88 // and the end of the spooling. | 88 // and the end of the spooling. |
| 89 bool is_job_pending() const; | 89 bool is_job_pending() const; |
| 90 | 90 |
| 91 // Returns true if the Print... dialog box is currently displayed. | |
| 92 bool is_print_dialog_box_shown() const; | |
| 93 | |
| 94 // Access the current printed document. Warning: may be NULL. | 91 // Access the current printed document. Warning: may be NULL. |
| 95 PrintedDocument* document() const; | 92 PrintedDocument* document() const; |
| 96 | 93 |
| 97 protected: | 94 protected: |
| 98 virtual ~PrintJob(); | 95 virtual ~PrintJob(); |
| 99 | 96 |
| 100 private: | 97 private: |
| 101 // Updates document_ to a new instance. | 98 // Updates document_ to a new instance. |
| 102 void UpdatePrintedDocument(PrintedDocument* new_document); | 99 void UpdatePrintedDocument(PrintedDocument* new_document); |
| 103 | 100 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 129 | 126 |
| 130 // Cache of the print context settings for access in the UI thread. | 127 // Cache of the print context settings for access in the UI thread. |
| 131 PrintSettings settings_; | 128 PrintSettings settings_; |
| 132 | 129 |
| 133 // The printed document. | 130 // The printed document. |
| 134 scoped_refptr<PrintedDocument> document_; | 131 scoped_refptr<PrintedDocument> document_; |
| 135 | 132 |
| 136 // Is the worker thread printing. | 133 // Is the worker thread printing. |
| 137 bool is_job_pending_; | 134 bool is_job_pending_; |
| 138 | 135 |
| 139 // Is the Print... dialog box currently shown. | |
| 140 bool is_print_dialog_box_shown_; | |
| 141 | |
| 142 // Is Canceling? If so, try to not cause recursion if on FAILED notification, | 136 // Is Canceling? If so, try to not cause recursion if on FAILED notification, |
| 143 // the notified calls Cancel() again. | 137 // the notified calls Cancel() again. |
| 144 bool is_canceling_; | 138 bool is_canceling_; |
| 145 | 139 |
| 146 DISALLOW_COPY_AND_ASSIGN(PrintJob); | 140 DISALLOW_COPY_AND_ASSIGN(PrintJob); |
| 147 }; | 141 }; |
| 148 | 142 |
| 149 // Details for a NOTIFY_PRINT_JOB_EVENT notification. The members may be NULL. | 143 // Details for a NOTIFY_PRINT_JOB_EVENT notification. The members may be NULL. |
| 150 class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> { | 144 class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> { |
| 151 public: | 145 public: |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 scoped_refptr<PrintedDocument> document_; | 195 scoped_refptr<PrintedDocument> document_; |
| 202 scoped_refptr<PrintedPage> page_; | 196 scoped_refptr<PrintedPage> page_; |
| 203 const Type type_; | 197 const Type type_; |
| 204 | 198 |
| 205 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); | 199 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); |
| 206 }; | 200 }; |
| 207 | 201 |
| 208 } // namespace printing | 202 } // namespace printing |
| 209 | 203 |
| 210 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ | 204 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ |
| OLD | NEW |