| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/common/chrome_switches.h" | 36 #include "chrome/common/chrome_switches.h" |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 #if defined(ENABLE_FULL_PRINTING) | 39 #if defined(ENABLE_FULL_PRINTING) |
| 40 #include "chrome/browser/printing/print_error_dialog.h" | 40 #include "chrome/browser/printing/print_error_dialog.h" |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 using base::TimeDelta; | 43 using base::TimeDelta; |
| 44 using content::BrowserThread; | 44 using content::BrowserThread; |
| 45 | 45 |
| 46 namespace { | 46 #if defined(OS_WIN) |
| 47 | |
| 48 // Limits memory usage by raster to 64 MiB. | 47 // Limits memory usage by raster to 64 MiB. |
| 49 const int kMaxRasterSizeInPixels = 16*1024*1024; | 48 const int kMaxRasterSizeInPixels = 16*1024*1024; |
| 50 | 49 #endif |
| 51 } // namespace | |
| 52 | 50 |
| 53 namespace printing { | 51 namespace printing { |
| 54 | 52 |
| 55 PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) | 53 PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) |
| 56 : content::WebContentsObserver(web_contents), | 54 : content::WebContentsObserver(web_contents), |
| 57 number_pages_(0), | 55 number_pages_(0), |
| 58 printing_succeeded_(false), | 56 printing_succeeded_(false), |
| 59 inside_inner_message_loop_(false), | 57 inside_inner_message_loop_(false), |
| 60 cookie_(0), | 58 cookie_(0), |
| 61 queue_(g_browser_process->print_job_manager()->queue()) { | 59 queue_(g_browser_process->print_job_manager()->queue()) { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 scoped_refptr<printing::PrinterQuery> printer_query; | 523 scoped_refptr<printing::PrinterQuery> printer_query; |
| 526 printer_query = queue_->PopPrinterQuery(cookie); | 524 printer_query = queue_->PopPrinterQuery(cookie); |
| 527 if (!printer_query) | 525 if (!printer_query) |
| 528 return; | 526 return; |
| 529 BrowserThread::PostTask( | 527 BrowserThread::PostTask( |
| 530 BrowserThread::IO, FROM_HERE, | 528 BrowserThread::IO, FROM_HERE, |
| 531 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 529 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
| 532 } | 530 } |
| 533 | 531 |
| 534 } // namespace printing | 532 } // namespace printing |
| OLD | NEW |