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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
39 #include "printing/metafile.h" | 39 #include "printing/metafile.h" |
40 #include "printing/metafile_impl.h" | 40 #include "printing/metafile_impl.h" |
41 #include "printing/print_destination_interface.h" | 41 #include "printing/print_destination_interface.h" |
42 #include "printing/printed_document.h" | 42 #include "printing/printed_document.h" |
43 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
44 | 44 |
45 using base::TimeDelta; | 45 using base::TimeDelta; |
46 using content::BrowserThread; | 46 using content::BrowserThread; |
47 | 47 |
48 int printing::PrintViewManager::kUserDataKey; | 48 DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintViewManager) |
49 | 49 |
50 namespace { | 50 namespace { |
51 | 51 |
52 // Keeps track of pending scripted print preview closures. | 52 // Keeps track of pending scripted print preview closures. |
53 // No locking, only access on the UI thread. | 53 // No locking, only access on the UI thread. |
54 typedef std::map<content::RenderProcessHost*, base::Closure> | 54 typedef std::map<content::RenderProcessHost*, base::Closure> |
55 ScriptedPrintPreviewClosureMap; | 55 ScriptedPrintPreviewClosureMap; |
56 static base::LazyInstance<ScriptedPrintPreviewClosureMap> | 56 static base::LazyInstance<ScriptedPrintPreviewClosureMap> |
57 g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; | 57 g_scripted_print_preview_closure_map = LAZY_INSTANCE_INITIALIZER; |
58 | 58 |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 scoped_refptr<printing::PrinterQuery> printer_query; | 683 scoped_refptr<printing::PrinterQuery> printer_query; |
684 print_job_manager->PopPrinterQuery(cookie, &printer_query); | 684 print_job_manager->PopPrinterQuery(cookie, &printer_query); |
685 if (!printer_query.get()) | 685 if (!printer_query.get()) |
686 return; | 686 return; |
687 BrowserThread::PostTask( | 687 BrowserThread::PostTask( |
688 BrowserThread::IO, FROM_HERE, | 688 BrowserThread::IO, FROM_HERE, |
689 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 689 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
690 } | 690 } |
691 | 691 |
692 } // namespace printing | 692 } // namespace printing |
OLD | NEW |