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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 profile->GetPrefs(), | 68 profile->GetPrefs(), |
69 base::Bind(&PrintViewManagerBase::UpdateScriptedPrintingBlocked, | 69 base::Bind(&PrintViewManagerBase::UpdateScriptedPrintingBlocked, |
70 base::Unretained(this))); | 70 base::Unretained(this))); |
71 } | 71 } |
72 | 72 |
73 PrintViewManagerBase::~PrintViewManagerBase() { | 73 PrintViewManagerBase::~PrintViewManagerBase() { |
74 ReleasePrinterQuery(); | 74 ReleasePrinterQuery(); |
75 DisconnectFromCurrentPrintJob(); | 75 DisconnectFromCurrentPrintJob(); |
76 } | 76 } |
77 | 77 |
| 78 #if !defined(DISABLE_BASIC_PRINTING) |
78 bool PrintViewManagerBase::PrintNow() { | 79 bool PrintViewManagerBase::PrintNow() { |
79 return PrintNowInternal(new PrintMsg_PrintPages(routing_id())); | 80 return PrintNowInternal(new PrintMsg_PrintPages(routing_id())); |
80 } | 81 } |
| 82 #endif // !DISABLE_BASIC_PRINTING |
81 | 83 |
82 void PrintViewManagerBase::UpdateScriptedPrintingBlocked() { | 84 void PrintViewManagerBase::UpdateScriptedPrintingBlocked() { |
83 Send(new PrintMsg_SetScriptedPrintingBlocked( | 85 Send(new PrintMsg_SetScriptedPrintingBlocked( |
84 routing_id(), | 86 routing_id(), |
85 !printing_enabled_.GetValue())); | 87 !printing_enabled_.GetValue())); |
86 } | 88 } |
87 | 89 |
88 void PrintViewManagerBase::NavigationStopped() { | 90 void PrintViewManagerBase::NavigationStopped() { |
89 // Cancel the current job, wait for the worker to finish. | 91 // Cancel the current job, wait for the worker to finish. |
90 TerminatePrintJob(true); | 92 TerminatePrintJob(true); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 scoped_refptr<printing::PrinterQuery> printer_query; | 563 scoped_refptr<printing::PrinterQuery> printer_query; |
562 printer_query = queue_->PopPrinterQuery(cookie); | 564 printer_query = queue_->PopPrinterQuery(cookie); |
563 if (!printer_query.get()) | 565 if (!printer_query.get()) |
564 return; | 566 return; |
565 BrowserThread::PostTask( | 567 BrowserThread::PostTask( |
566 BrowserThread::IO, FROM_HERE, | 568 BrowserThread::IO, FROM_HERE, |
567 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 569 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
568 } | 570 } |
569 | 571 |
570 } // namespace printing | 572 } // namespace printing |
OLD | NEW |