| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Stops all printing jobs. If wait_for_finish is true, tries to give jobs | 39 // Stops all printing jobs. If wait_for_finish is true, tries to give jobs |
| 40 // a chance to complete before stopping them. | 40 // a chance to complete before stopping them. |
| 41 void StopJobs(bool wait_for_finish); | 41 void StopJobs(bool wait_for_finish); |
| 42 | 42 |
| 43 // Queues a semi-initialized worker thread. Can be called from any thread. | 43 // Queues a semi-initialized worker thread. Can be called from any thread. |
| 44 // Current use case is queuing from the I/O thread. | 44 // Current use case is queuing from the I/O thread. |
| 45 // TODO(maruel): Have them vanish after a timeout (~5 minutes?) | 45 // TODO(maruel): Have them vanish after a timeout (~5 minutes?) |
| 46 void QueuePrinterQuery(PrinterQuery* job); | 46 void QueuePrinterQuery(PrinterQuery* job); |
| 47 | 47 |
| 48 // Pops a queued PrintJobWorkerOwner object and posts a task to stop the |
| 49 // worker. Can be called from any thread. |
| 50 void PopAndStopPrinterQuery(int document_cookie); |
| 51 |
| 48 // Pops a queued PrintJobWorkerOwner object that was previously queued. Can be | 52 // Pops a queued PrintJobWorkerOwner object that was previously queued. Can be |
| 49 // called from any thread. Current use case is poping from the browser thread. | 53 // called from any thread. Current use case is poping from the browser thread. |
| 50 void PopPrinterQuery(int document_cookie, scoped_refptr<PrinterQuery>* job); | 54 void PopPrinterQuery(int document_cookie, scoped_refptr<PrinterQuery>* job); |
| 51 | 55 |
| 52 static void RegisterPrefs(PrefService* prefs); | 56 static void RegisterPrefs(PrefService* prefs); |
| 53 | 57 |
| 54 // NotificationObserver | 58 // NotificationObserver |
| 55 virtual void Observe(NotificationType type, | 59 virtual void Observe(NotificationType type, |
| 56 const NotificationSource& source, | 60 const NotificationSource& source, |
| 57 const NotificationDetails& details); | 61 const NotificationDetails& details); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 83 | 87 |
| 84 // Current print jobs that are active. | 88 // Current print jobs that are active. |
| 85 PrintJobs current_jobs_; | 89 PrintJobs current_jobs_; |
| 86 | 90 |
| 87 DISALLOW_COPY_AND_ASSIGN(PrintJobManager); | 91 DISALLOW_COPY_AND_ASSIGN(PrintJobManager); |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 } // namespace printing | 94 } // namespace printing |
| 91 | 95 |
| 92 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ | 96 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ |
| OLD | NEW |