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

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

Issue 478183005: Added PrintingContext::Delegate to get parent view handle and application locale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mon Aug 25 23:50:54 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
14 #include "base/threading/non_thread_safe.h" 15 #include "base/threading/non_thread_safe.h"
15 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
16 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
17 #include "printing/print_destination_interface.h" 18 #include "printing/print_destination_interface.h"
18 19
19 namespace printing { 20 namespace printing {
20 21
21 class JobEventDetails; 22 class JobEventDetails;
22 class PrintJob; 23 class PrintJob;
23 class PrinterQuery; 24 class PrinterQuery;
24 25
25 class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> { 26 class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
26 public: 27 public:
27 PrintQueriesQueue(); 28 PrintQueriesQueue();
28 29
29 // Sets the print destination to be set on the next print job. 30 // Sets the print destination to be set on the next print job.
30 void SetDestination(PrintDestinationInterface* destination); 31 void SetDestination(PrintDestinationInterface* destination);
31 32
32 // Queues a semi-initialized worker thread. Can be called from any thread. 33 // Queues a semi-initialized worker thread. Can be called from any thread.
33 // Current use case is queuing from the I/O thread. 34 // Current use case is queuing from the I/O thread.
34 // TODO(maruel): Have them vanish after a timeout (~5 minutes?) 35 // TODO(maruel): Have them vanish after a timeout (~5 minutes?)
35 void QueuePrinterQuery(PrinterQuery* job); 36 void QueuePrinterQuery(PrinterQuery* job);
36 37
37 // Pops a queued PrintJobWorkerOwner object that was previously queued or 38 // Pops a queued PrintJobWorkerOwner object that was previously queued or
38 // create new one. Can be called from any thread. 39 // create new one. Can be called from any thread.
39 scoped_refptr<PrinterQuery> PopPrinterQuery(int document_cookie); 40 scoped_refptr<PrinterQuery> PopPrinterQuery(int document_cookie);
40 41
41 // Creates new query. 42 // Creates new query.
42 scoped_refptr<PrinterQuery> CreatePrinterQuery(); 43 scoped_refptr<PrinterQuery> CreatePrinterQuery(int render_process_id,
44 int render_view_id);
43 45
44 void Shutdown(); 46 void Shutdown();
45 47
46 private: 48 private:
47 friend class base::RefCountedThreadSafe<PrintQueriesQueue>; 49 friend class base::RefCountedThreadSafe<PrintQueriesQueue>;
48 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries; 50 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries;
49 51
50 virtual ~PrintQueriesQueue(); 52 virtual ~PrintQueriesQueue();
51 53
52 // Used to serialize access to queued_workers_. 54 // Used to serialize access to queued_workers_.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 scoped_refptr<PrintQueriesQueue> queue_; 97 scoped_refptr<PrintQueriesQueue> queue_;
96 98
97 bool is_shutdown_; 99 bool is_shutdown_;
98 100
99 DISALLOW_COPY_AND_ASSIGN(PrintJobManager); 101 DISALLOW_COPY_AND_ASSIGN(PrintJobManager);
100 }; 102 };
101 103
102 } // namespace printing 104 } // namespace printing
103 105
104 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ 106 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698