| 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 #include "chrome/browser/printing/print_job_worker.h" | 5 #include "chrome/browser/printing/print_job_worker.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
| 10 #include "chrome/browser/printing/print_job.h" | 10 #include "chrome/browser/printing/print_job.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 void PrintJobWorker::Cancel() { | 219 void PrintJobWorker::Cancel() { |
| 220 // This is the only function that can be called from any thread. | 220 // This is the only function that can be called from any thread. |
| 221 printing_context_->Cancel(); | 221 printing_context_->Cancel(); |
| 222 // Cannot touch any member variable since we don't know in which thread | 222 // Cannot touch any member variable since we don't know in which thread |
| 223 // context we run. | 223 // context we run. |
| 224 } | 224 } |
| 225 | 225 |
| 226 void PrintJobWorker::DismissDialog() { | |
| 227 printing_context_->DismissDialog(); | |
| 228 } | |
| 229 | |
| 230 void PrintJobWorker::OnDocumentDone() { | 226 void PrintJobWorker::OnDocumentDone() { |
| 231 DCHECK_EQ(message_loop(), MessageLoop::current()); | 227 DCHECK_EQ(message_loop(), MessageLoop::current()); |
| 232 DCHECK_EQ(page_number_, PageNumber::npos()); | 228 DCHECK_EQ(page_number_, PageNumber::npos()); |
| 233 DCHECK(document_.get()); | 229 DCHECK(document_.get()); |
| 234 | 230 |
| 235 if (printing_context_->DocumentDone() != PrintingContext::OK) { | 231 if (printing_context_->DocumentDone() != PrintingContext::OK) { |
| 236 OnFailure(); | 232 OnFailure(); |
| 237 return; | 233 return; |
| 238 } | 234 } |
| 239 | 235 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 printing::PrintJobWorker* obj) { | 306 printing::PrintJobWorker* obj) { |
| 311 DCHECK(!owner_.get()); | 307 DCHECK(!owner_.get()); |
| 312 owner_ = obj->owner_; | 308 owner_ = obj->owner_; |
| 313 } | 309 } |
| 314 | 310 |
| 315 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee( | 311 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee( |
| 316 printing::PrintJobWorker* obj) { | 312 printing::PrintJobWorker* obj) { |
| 317 DCHECK_EQ(owner_, obj->owner_); | 313 DCHECK_EQ(owner_, obj->owner_); |
| 318 owner_ = NULL; | 314 owner_ = NULL; |
| 319 } | 315 } |
| OLD | NEW |