Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/printing/print_job.h

Issue 2643163002: Refactor print_job.cc (Closed)
Patch Set: Fix constructor Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/printing/print_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Terminates the worker thread in a very controlled way, to work around any 118 // Terminates the worker thread in a very controlled way, to work around any
119 // eventual deadlock. 119 // eventual deadlock.
120 void ControlledWorkerShutdown(); 120 void ControlledWorkerShutdown();
121 121
122 // Called at shutdown when running a nested message loop. 122 // Called at shutdown when running a nested message loop.
123 void Quit(); 123 void Quit();
124 124
125 void HoldUntilStopIsCalled(); 125 void HoldUntilStopIsCalled();
126 126
127 #if defined(OS_WIN) 127 #if defined(OS_WIN)
128 void OnPdfToEmfStarted(int page_count); 128 void OnPdfConversionStarted(int page_count);
129 void OnPdfToEmfPageConverted(int page_number, 129 void OnPdfPageConverted(int page_number,
130 float scale_factor, 130 float scale_factor,
131 std::unique_ptr<MetafilePlayer> emf); 131 std::unique_ptr<MetafilePlayer> emf);
132 #endif // defined(OS_WIN) 132 #endif // defined(OS_WIN)
133 133
134 content::NotificationRegistrar registrar_; 134 content::NotificationRegistrar registrar_;
135 135
136 // Source that generates the PrintedPage's (i.e. a WebContents). It will be 136 // Source that generates the PrintedPage's (i.e. a WebContents). It will be
137 // set back to NULL if the source is deleted before this object. 137 // set back to NULL if the source is deleted before this object.
138 PrintedPagesSource* source_; 138 PrintedPagesSource* source_;
139 139
140 // All the UI is done in a worker thread because many Win32 print functions 140 // All the UI is done in a worker thread because many Win32 print functions
141 // are blocking and enters a message loop without your consent. There is one 141 // are blocking and enters a message loop without your consent. There is one
142 // worker thread per print job. 142 // worker thread per print job.
143 std::unique_ptr<PrintJobWorker> worker_; 143 std::unique_ptr<PrintJobWorker> worker_;
144 144
145 // Cache of the print context settings for access in the UI thread. 145 // Cache of the print context settings for access in the UI thread.
146 PrintSettings settings_; 146 PrintSettings settings_;
147 147
148 // The printed document. 148 // The printed document.
149 scoped_refptr<PrintedDocument> document_; 149 scoped_refptr<PrintedDocument> document_;
150 150
151 // Is the worker thread printing. 151 // Is the worker thread printing.
152 bool is_job_pending_; 152 bool is_job_pending_;
153 153
154 // Is Canceling? If so, try to not cause recursion if on FAILED notification, 154 // Is Canceling? If so, try to not cause recursion if on FAILED notification,
155 // the notified calls Cancel() again. 155 // the notified calls Cancel() again.
156 bool is_canceling_; 156 bool is_canceling_;
157 157
158 #if defined(OS_WIN) 158 #if defined(OS_WIN)
159 class PdfToEmfState; 159 class PdfConversionState;
160 std::unique_ptr<PdfToEmfState> pdf_to_emf_state_; 160 std::unique_ptr<PdfConversionState> pdf_conversion_state_;
161 std::vector<int> pdf_page_mapping_; 161 std::vector<int> pdf_page_mapping_;
162 #endif // defined(OS_WIN) 162 #endif // defined(OS_WIN)
163 163
164 // Used at shutdown so that we can quit a nested message loop. 164 // Used at shutdown so that we can quit a nested message loop.
165 base::WeakPtrFactory<PrintJob> quit_factory_; 165 base::WeakPtrFactory<PrintJob> quit_factory_;
166 166
167 DISALLOW_COPY_AND_ASSIGN(PrintJob); 167 DISALLOW_COPY_AND_ASSIGN(PrintJob);
168 }; 168 };
169 169
170 // Details for a NOTIFY_PRINT_JOB_EVENT notification. The members may be NULL. 170 // Details for a NOTIFY_PRINT_JOB_EVENT notification. The members may be NULL.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 scoped_refptr<PrintedDocument> document_; 222 scoped_refptr<PrintedDocument> document_;
223 scoped_refptr<PrintedPage> page_; 223 scoped_refptr<PrintedPage> page_;
224 const Type type_; 224 const Type type_;
225 225
226 DISALLOW_COPY_AND_ASSIGN(JobEventDetails); 226 DISALLOW_COPY_AND_ASSIGN(JobEventDetails);
227 }; 227 };
228 228
229 } // namespace printing 229 } // namespace printing
230 230
231 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_ 231 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698