| 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_WORKER_H__ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 void OnDocumentChanged(PrintedDocument* new_document); | 50 void OnDocumentChanged(PrintedDocument* new_document); |
| 51 | 51 |
| 52 // Unqueues waiting pages. Called when PrintJob receives a | 52 // Unqueues waiting pages. Called when PrintJob receives a |
| 53 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if | 53 // NOTIFY_PRINTED_DOCUMENT_UPDATED notification. It's time to look again if |
| 54 // the next page can be printed. | 54 // the next page can be printed. |
| 55 void OnNewPage(); | 55 void OnNewPage(); |
| 56 | 56 |
| 57 // This is the only function that can be called in a thread. | 57 // This is the only function that can be called in a thread. |
| 58 void Cancel(); | 58 void Cancel(); |
| 59 | 59 |
| 60 // Cancels the Print... dialog box if shown, noop otherwise. | |
| 61 void DismissDialog(); | |
| 62 | |
| 63 protected: | 60 protected: |
| 64 // Retrieves the context for testing only. | 61 // Retrieves the context for testing only. |
| 65 PrintingContext* printing_context() { return printing_context_.get(); } | 62 PrintingContext* printing_context() { return printing_context_.get(); } |
| 66 | 63 |
| 67 private: | 64 private: |
| 68 // The shared NotificationService service can only be accessed from the UI | 65 // The shared NotificationService service can only be accessed from the UI |
| 69 // thread, so this class encloses the necessary information to send the | 66 // thread, so this class encloses the necessary information to send the |
| 70 // notification from the right thread. Most NOTIFY_PRINT_JOB_EVENT | 67 // notification from the right thread. Most NOTIFY_PRINT_JOB_EVENT |
| 71 // notifications are sent this way, except USER_INIT_DONE, USER_INIT_CANCELED | 68 // notifications are sent this way, except USER_INIT_DONE, USER_INIT_CANCELED |
| 72 // and DEFAULT_INIT_DONE. These three are sent through PrintJob::InitDone(). | 69 // and DEFAULT_INIT_DONE. These three are sent through PrintJob::InitDone(). |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 120 |
| 124 template <> | 121 template <> |
| 125 struct RunnableMethodTraits<printing::PrintJobWorker> { | 122 struct RunnableMethodTraits<printing::PrintJobWorker> { |
| 126 void RetainCallee(printing::PrintJobWorker* obj); | 123 void RetainCallee(printing::PrintJobWorker* obj); |
| 127 void ReleaseCallee(printing::PrintJobWorker* obj); | 124 void ReleaseCallee(printing::PrintJobWorker* obj); |
| 128 private: | 125 private: |
| 129 scoped_refptr<printing::PrintJobWorkerOwner> owner_; | 126 scoped_refptr<printing::PrintJobWorkerOwner> owner_; |
| 130 }; | 127 }; |
| 131 | 128 |
| 132 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ | 129 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H__ |
| OLD | NEW |