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 #include "chrome/browser/printing/print_view_manager_base.h" | 5 #include "chrome/browser/printing/print_view_manager_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) { | 151 if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) { |
152 NOTREACHED() << "Invalid metafile header"; | 152 NOTREACHED() << "Invalid metafile header"; |
153 web_contents()->Stop(); | 153 web_contents()->Stop(); |
154 return; | 154 return; |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 #if !defined(OS_WIN) | 158 #if !defined(OS_WIN) |
159 // Update the rendered document. It will send notifications to the listener. | 159 // Update the rendered document. It will send notifications to the listener. |
160 document->SetPage(params.page_number, | 160 document->SetPage(params.page_number, |
161 metafile.PassAs<MetafilePlayer>(), | 161 metafile.Pass(), |
162 params.page_size, | 162 params.page_size, |
163 params.content_area); | 163 params.content_area); |
164 | 164 |
165 ShouldQuitFromInnerMessageLoop(); | 165 ShouldQuitFromInnerMessageLoop(); |
166 #else | 166 #else |
167 if (metafile_must_be_valid) { | 167 if (metafile_must_be_valid) { |
168 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( | 168 scoped_refptr<base::RefCountedBytes> bytes = new base::RefCountedBytes( |
169 reinterpret_cast<const unsigned char*>(shared_buf.memory()), | 169 reinterpret_cast<const unsigned char*>(shared_buf.memory()), |
170 params.data_size); | 170 params.data_size); |
171 | 171 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 scoped_refptr<printing::PrinterQuery> printer_query; | 515 scoped_refptr<printing::PrinterQuery> printer_query; |
516 printer_query = queue_->PopPrinterQuery(cookie); | 516 printer_query = queue_->PopPrinterQuery(cookie); |
517 if (!printer_query.get()) | 517 if (!printer_query.get()) |
518 return; | 518 return; |
519 BrowserThread::PostTask( | 519 BrowserThread::PostTask( |
520 BrowserThread::IO, FROM_HERE, | 520 BrowserThread::IO, FROM_HERE, |
521 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 521 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
522 } | 522 } |
523 | 523 |
524 } // namespace printing | 524 } // namespace printing |
OLD | NEW |