| OLD | NEW |
| 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 #include "chrome/browser/printing/print_job_worker.h" | 5 #include "chrome/browser/printing/print_job_worker.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 printing_context_->settings(), | 206 printing_context_->settings(), |
| 207 result)); | 207 result)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void PrintJobWorker::GetSettingsWithUI( | 210 void PrintJobWorker::GetSettingsWithUI( |
| 211 int document_page_count, | 211 int document_page_count, |
| 212 bool has_selection, | 212 bool has_selection, |
| 213 bool is_scripted) { | 213 bool is_scripted) { |
| 214 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 214 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 215 | 215 |
| 216 #if defined(OS_ANDROID) | 216 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 217 if (is_scripted) { | 217 if (is_scripted) { |
| 218 PrintingContextDelegate* printing_context_delegate = | 218 PrintingContextDelegate* printing_context_delegate = |
| 219 static_cast<PrintingContextDelegate*>(printing_context_delegate_.get()); | 219 static_cast<PrintingContextDelegate*>(printing_context_delegate_.get()); |
| 220 content::WebContents* web_contents = | 220 content::WebContents* web_contents = |
| 221 printing_context_delegate->GetWebContents(); | 221 printing_context_delegate->GetWebContents(); |
| 222 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); | 222 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); |
| 223 | 223 |
| 224 // Regardless of whether the following call fails or not, the javascript | 224 // Regardless of whether the following call fails or not, the javascript |
| 225 // call will return since startPendingPrint will make it return immediately | 225 // call will return since startPendingPrint will make it return immediately |
| 226 // in case of error. | 226 // in case of error. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 document_, | 434 document_, |
| 435 scoped_refptr<PrintedPage>())); | 435 scoped_refptr<PrintedPage>())); |
| 436 Cancel(); | 436 Cancel(); |
| 437 | 437 |
| 438 // Makes sure the variables are reinitialized. | 438 // Makes sure the variables are reinitialized. |
| 439 document_ = NULL; | 439 document_ = NULL; |
| 440 page_number_ = PageNumber::npos(); | 440 page_number_ = PageNumber::npos(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace printing | 443 } // namespace printing |
| OLD | NEW |