Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2491)

Side by Side Diff: chrome/browser/printing/print_job_manager.h

Issue 524543002: Removed IDC_PRINT_TO_DESTINATION. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fri Aug 29 14:26:26 PDT 2014 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/app/chrome_command_ids.h ('k') | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
15 #include "base/threading/non_thread_safe.h" 15 #include "base/threading/non_thread_safe.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "printing/print_destination_interface.h"
19 18
20 namespace printing { 19 namespace printing {
21 20
22 class JobEventDetails; 21 class JobEventDetails;
23 class PrintJob; 22 class PrintJob;
24 class PrinterQuery; 23 class PrinterQuery;
25 24
26 class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> { 25 class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
27 public: 26 public:
28 PrintQueriesQueue(); 27 PrintQueriesQueue();
29 28
30 // Sets the print destination to be set on the next print job.
31 void SetDestination(PrintDestinationInterface* destination);
32
33 // Queues a semi-initialized worker thread. Can be called from any thread. 29 // Queues a semi-initialized worker thread. Can be called from any thread.
34 // Current use case is queuing from the I/O thread. 30 // Current use case is queuing from the I/O thread.
35 // TODO(maruel): Have them vanish after a timeout (~5 minutes?) 31 // TODO(maruel): Have them vanish after a timeout (~5 minutes?)
36 void QueuePrinterQuery(PrinterQuery* job); 32 void QueuePrinterQuery(PrinterQuery* job);
37 33
38 // Pops a queued PrintJobWorkerOwner object that was previously queued or 34 // Pops a queued PrintJobWorkerOwner object that was previously queued or
39 // create new one. Can be called from any thread. 35 // create new one. Can be called from any thread.
40 scoped_refptr<PrinterQuery> PopPrinterQuery(int document_cookie); 36 scoped_refptr<PrinterQuery> PopPrinterQuery(int document_cookie);
41 37
42 // Creates new query. 38 // Creates new query.
43 scoped_refptr<PrinterQuery> CreatePrinterQuery(int render_process_id, 39 scoped_refptr<PrinterQuery> CreatePrinterQuery(int render_process_id,
44 int render_view_id); 40 int render_view_id);
45 41
46 void Shutdown(); 42 void Shutdown();
47 43
48 private: 44 private:
49 friend class base::RefCountedThreadSafe<PrintQueriesQueue>; 45 friend class base::RefCountedThreadSafe<PrintQueriesQueue>;
50 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries; 46 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries;
51 47
52 virtual ~PrintQueriesQueue(); 48 virtual ~PrintQueriesQueue();
53 49
54 // Used to serialize access to queued_workers_. 50 // Used to serialize access to queued_workers_.
55 base::Lock lock_; 51 base::Lock lock_;
56 52
57 PrinterQueries queued_queries_; 53 PrinterQueries queued_queries_;
58 54
59 scoped_refptr<PrintDestinationInterface> destination_;
60
61 DISALLOW_COPY_AND_ASSIGN(PrintQueriesQueue); 55 DISALLOW_COPY_AND_ASSIGN(PrintQueriesQueue);
62 }; 56 };
63 57
64 class PrintJobManager : public content::NotificationObserver { 58 class PrintJobManager : public content::NotificationObserver {
65 public: 59 public:
66 PrintJobManager(); 60 PrintJobManager();
67 virtual ~PrintJobManager(); 61 virtual ~PrintJobManager();
68 62
69 // On browser quit, we should wait to have the print job finished. 63 // On browser quit, we should wait to have the print job finished.
70 void Shutdown(); 64 void Shutdown();
(...skipping 26 matching lines...) Expand all
97 scoped_refptr<PrintQueriesQueue> queue_; 91 scoped_refptr<PrintQueriesQueue> queue_;
98 92
99 bool is_shutdown_; 93 bool is_shutdown_;
100 94
101 DISALLOW_COPY_AND_ASSIGN(PrintJobManager); 95 DISALLOW_COPY_AND_ASSIGN(PrintJobManager);
102 }; 96 };
103 97
104 } // namespace printing 98 } // namespace printing
105 99
106 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ 100 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/app/chrome_command_ids.h ('k') | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698