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 #include "chrome/browser/printing/print_view_manager.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/navigation_entry.h" | 8 #include "chrome/browser/navigation_entry.h" |
9 #include "chrome/browser/printing/print_job.h" | 9 #include "chrome/browser/printing/print_job.h" |
10 #include "chrome/browser/printing/print_job_manager.h" | 10 #include "chrome/browser/printing/print_job_manager.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // http://msdn2.microsoft.com/en-us/library/ms535522.aspx | 124 // http://msdn2.microsoft.com/en-us/library/ms535522.aspx |
125 // Windows 2000/XP: When a page in a spooled file exceeds approximately 350 | 125 // Windows 2000/XP: When a page in a spooled file exceeds approximately 350 |
126 // MB, it can fail to print and not send an error message. | 126 // MB, it can fail to print and not send an error message. |
127 if (params.data_size && params.data_size >= 350*1024*1024) { | 127 if (params.data_size && params.data_size >= 350*1024*1024) { |
128 NOTREACHED() << "size:" << params.data_size; | 128 NOTREACHED() << "size:" << params.data_size; |
129 TerminatePrintJob(true); | 129 TerminatePrintJob(true); |
130 owner_.Stop(); | 130 owner_.Stop(); |
131 return; | 131 return; |
132 } | 132 } |
133 | 133 |
134 SharedMemory shared_buf(params.emf_data_handle, true); | 134 base::SharedMemory shared_buf(params.emf_data_handle, true); |
135 if (!shared_buf.Map(params.data_size)) { | 135 if (!shared_buf.Map(params.data_size)) { |
136 NOTREACHED() << "couldn't map"; | 136 NOTREACHED() << "couldn't map"; |
137 owner_.Stop(); | 137 owner_.Stop(); |
138 return; | 138 return; |
139 } | 139 } |
140 | 140 |
141 gfx::Emf* emf = new gfx::Emf; | 141 gfx::Emf* emf = new gfx::Emf; |
142 if (!emf->CreateFromData(shared_buf.memory(), params.data_size)) { | 142 if (!emf->CreateFromData(shared_buf.memory(), params.data_size)) { |
143 NOTREACHED() << "Invalid EMF header"; | 143 NOTREACHED() << "Invalid EMF header"; |
144 delete emf; | 144 delete emf; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 } | 542 } |
543 | 543 |
544 // Settings are already loaded. Go ahead. This will set | 544 // Settings are already loaded. Go ahead. This will set |
545 // print_job_->is_job_pending() to true. | 545 // print_job_->is_job_pending() to true. |
546 print_job_->StartPrinting(); | 546 print_job_->StartPrinting(); |
547 return true; | 547 return true; |
548 } | 548 } |
549 | 549 |
550 } // namespace printing | 550 } // namespace printing |
551 | 551 |
OLD | NEW |