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_dialog_gtk.h" | 5 #include "chrome/browser/printing/print_dialog_gtk.h" |
6 | 6 |
7 #include <gtk/gtkunixprint.h> | 7 #include <gtk/gtkunixprint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 void PrintDialogGtk::PrintDocument(const printing::Metafile* metafile, | 267 void PrintDialogGtk::PrintDocument(const printing::Metafile* metafile, |
268 const string16& document_name) { | 268 const string16& document_name) { |
269 // This runs on the print worker thread, does not block the UI thread. | 269 // This runs on the print worker thread, does not block the UI thread. |
270 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); | 270 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); |
271 | 271 |
272 // The document printing tasks can outlive the PrintingContext that created | 272 // The document printing tasks can outlive the PrintingContext that created |
273 // this dialog. | 273 // this dialog. |
274 AddRef(); | 274 AddRef(); |
275 | 275 |
276 bool error = false; | 276 bool error = false; |
277 if (!file_util::CreateTemporaryFile(&path_to_pdf_)) { | 277 if (!base::CreateTemporaryFile(&path_to_pdf_)) { |
278 LOG(ERROR) << "Creating temporary file failed"; | 278 LOG(ERROR) << "Creating temporary file failed"; |
279 error = true; | 279 error = true; |
280 } | 280 } |
281 | 281 |
282 if (!error && !metafile->SaveTo(path_to_pdf_)) { | 282 if (!error && !metafile->SaveTo(path_to_pdf_)) { |
283 LOG(ERROR) << "Saving metafile failed"; | 283 LOG(ERROR) << "Saving metafile failed"; |
284 base::DeleteFile(path_to_pdf_, false); | 284 base::DeleteFile(path_to_pdf_, false); |
285 error = true; | 285 error = true; |
286 } | 286 } |
287 | 287 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 base::FileUtilProxy::StatusCallback()); | 427 base::FileUtilProxy::StatusCallback()); |
428 // Printing finished. Matches AddRef() in PrintDocument(); | 428 // Printing finished. Matches AddRef() in PrintDocument(); |
429 Release(); | 429 Release(); |
430 } | 430 } |
431 | 431 |
432 void PrintDialogGtk::InitPrintSettings(PrintSettings* settings) { | 432 void PrintDialogGtk::InitPrintSettings(PrintSettings* settings) { |
433 printing::PrintSettingsInitializerGtk::InitPrintSettings( | 433 printing::PrintSettingsInitializerGtk::InitPrintSettings( |
434 gtk_settings_, page_setup_, settings); | 434 gtk_settings_, page_setup_, settings); |
435 context_->InitWithSettings(*settings); | 435 context_->InitWithSettings(*settings); |
436 } | 436 } |
OLD | NEW |