| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| 11 #include "base/lock.h" | |
| 12 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/synchronization/lock.h" |
| 13 #include "chrome/common/notification_observer.h" | 13 #include "chrome/common/notification_observer.h" |
| 14 #include "chrome/common/notification_registrar.h" | 14 #include "chrome/common/notification_registrar.h" |
| 15 | 15 |
| 16 namespace printing { | 16 namespace printing { |
| 17 | 17 |
| 18 class JobEventDetails; | 18 class JobEventDetails; |
| 19 class PrintedDocument; | 19 class PrintedDocument; |
| 20 class PrintJob; | 20 class PrintJob; |
| 21 class PrintedPage; | 21 class PrintedPage; |
| 22 class PrinterQuery; | 22 class PrinterQuery; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 typedef std::vector<scoped_refptr<PrintJob> > PrintJobs; | 55 typedef std::vector<scoped_refptr<PrintJob> > PrintJobs; |
| 56 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries; | 56 typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries; |
| 57 | 57 |
| 58 // Processes a NOTIFY_PRINT_JOB_EVENT notification. | 58 // Processes a NOTIFY_PRINT_JOB_EVENT notification. |
| 59 void OnPrintJobEvent(PrintJob* print_job, | 59 void OnPrintJobEvent(PrintJob* print_job, |
| 60 const JobEventDetails& event_details); | 60 const JobEventDetails& event_details); |
| 61 | 61 |
| 62 NotificationRegistrar registrar_; | 62 NotificationRegistrar registrar_; |
| 63 | 63 |
| 64 // Used to serialize access to queued_workers_. | 64 // Used to serialize access to queued_workers_. |
| 65 Lock lock_; | 65 base::Lock lock_; |
| 66 | 66 |
| 67 // Used to serialize access to printing_enabled_ | 67 // Used to serialize access to printing_enabled_ |
| 68 Lock enabled_lock_; | 68 base::Lock enabled_lock_; |
| 69 | 69 |
| 70 PrinterQueries queued_queries_; | 70 PrinterQueries queued_queries_; |
| 71 | 71 |
| 72 // Current print jobs that are active. | 72 // Current print jobs that are active. |
| 73 PrintJobs current_jobs_; | 73 PrintJobs current_jobs_; |
| 74 | 74 |
| 75 // Printing is enabled/disabled. This variable is checked at only one place, | 75 // Printing is enabled/disabled. This variable is checked at only one place, |
| 76 // by RenderMessageFilter::OnGetDefaultPrintSettings. If its value is true | 76 // by RenderMessageFilter::OnGetDefaultPrintSettings. If its value is true |
| 77 // at that point, then the initiated print flow will complete itself, | 77 // at that point, then the initiated print flow will complete itself, |
| 78 // even if the value of this variable changes afterwards. | 78 // even if the value of this variable changes afterwards. |
| 79 bool printing_enabled_; | 79 bool printing_enabled_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(PrintJobManager); | 81 DISALLOW_COPY_AND_ASSIGN(PrintJobManager); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace printing | 84 } // namespace printing |
| 85 | 85 |
| 86 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ | 86 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_MANAGER_H_ |
| OLD | NEW |