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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 } | 544 } |
545 return Send(message); | 545 return Send(message); |
546 } | 546 } |
547 | 547 |
548 void PrintViewManagerBase::ReleasePrinterQuery() { | 548 void PrintViewManagerBase::ReleasePrinterQuery() { |
549 if (!cookie_) | 549 if (!cookie_) |
550 return; | 550 return; |
551 | 551 |
552 int cookie = cookie_; | 552 int cookie = cookie_; |
553 cookie_ = 0; | 553 cookie_ = 0; |
554 queue_->SetDestination(NULL); | |
555 | |
556 | 554 |
557 printing::PrintJobManager* print_job_manager = | 555 printing::PrintJobManager* print_job_manager = |
558 g_browser_process->print_job_manager(); | 556 g_browser_process->print_job_manager(); |
559 // May be NULL in tests. | 557 // May be NULL in tests. |
560 if (!print_job_manager) | 558 if (!print_job_manager) |
561 return; | 559 return; |
562 | 560 |
563 scoped_refptr<printing::PrinterQuery> printer_query; | 561 scoped_refptr<printing::PrinterQuery> printer_query; |
564 printer_query = queue_->PopPrinterQuery(cookie); | 562 printer_query = queue_->PopPrinterQuery(cookie); |
565 if (!printer_query.get()) | 563 if (!printer_query.get()) |
566 return; | 564 return; |
567 BrowserThread::PostTask( | 565 BrowserThread::PostTask( |
568 BrowserThread::IO, FROM_HERE, | 566 BrowserThread::IO, FROM_HERE, |
569 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 567 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
570 } | 568 } |
571 | 569 |
572 } // namespace printing | 570 } // namespace printing |
OLD | NEW |