| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "printing/metafile.h" | 30 #include "printing/metafile.h" |
| 31 #include "printing/metafile_impl.h" | 31 #include "printing/metafile_impl.h" |
| 32 #include "printing/printed_document.h" | 32 #include "printing/printed_document.h" |
| 33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 34 | 34 |
| 35 using base::TimeDelta; | 35 using base::TimeDelta; |
| 36 using content::BrowserThread; | 36 using content::BrowserThread; |
| 37 using content::RenderViewHost; |
| 37 | 38 |
| 38 namespace { | 39 namespace { |
| 39 | 40 |
| 40 // Keeps track of pending scripted print preview closures. | 41 // Keeps track of pending scripted print preview closures. |
| 41 // No locking, only access on the UI thread. | 42 // No locking, only access on the UI thread. |
| 42 typedef std::map<content::RenderProcessHost*, base::Closure> | 43 typedef std::map<content::RenderProcessHost*, base::Closure> |
| 43 ScriptedPrintPreviewClosureMap; | 44 ScriptedPrintPreviewClosureMap; |
| 44 static base::LazyInstance<ScriptedPrintPreviewClosureMap> | 45 static base::LazyInstance<ScriptedPrintPreviewClosureMap> |
| 45 g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; | 46 g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; |
| 46 | 47 |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 scoped_refptr<printing::PrinterQuery> printer_query; | 614 scoped_refptr<printing::PrinterQuery> printer_query; |
| 614 print_job_manager->PopPrinterQuery(cookie, &printer_query); | 615 print_job_manager->PopPrinterQuery(cookie, &printer_query); |
| 615 if (!printer_query.get()) | 616 if (!printer_query.get()) |
| 616 return; | 617 return; |
| 617 BrowserThread::PostTask( | 618 BrowserThread::PostTask( |
| 618 BrowserThread::IO, FROM_HERE, | 619 BrowserThread::IO, FROM_HERE, |
| 619 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 620 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
| 620 } | 621 } |
| 621 | 622 |
| 622 } // namespace printing | 623 } // namespace printing |
| OLD | NEW |