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 <fcntl.h> | 7 #include <fcntl.h> |
8 #include <gtk/gtkunixprint.h> | 8 #include <gtk/gtkunixprint.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 GError* error) { | 400 GError* error) { |
401 static_cast<PrintDialogGtk*>(user_data)->OnJobCompleted(print_job, error); | 401 static_cast<PrintDialogGtk*>(user_data)->OnJobCompleted(print_job, error); |
402 } | 402 } |
403 | 403 |
404 void PrintDialogGtk::OnJobCompleted(GtkPrintJob* print_job, GError* error) { | 404 void PrintDialogGtk::OnJobCompleted(GtkPrintJob* print_job, GError* error) { |
405 if (error) | 405 if (error) |
406 LOG(ERROR) << "Printing failed: " << error->message; | 406 LOG(ERROR) << "Printing failed: " << error->message; |
407 if (print_job) | 407 if (print_job) |
408 g_object_unref(print_job); | 408 g_object_unref(print_job); |
409 base::FileUtilProxy::Delete( | 409 base::FileUtilProxy::Delete( |
410 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 410 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), |
411 path_to_pdf_, false, base::FileUtilProxy::StatusCallback()); | 411 path_to_pdf_, |
| 412 false, |
| 413 base::FileUtilProxy::StatusCallback()); |
412 // Printing finished. Matches AddRef() in PrintDocument(); | 414 // Printing finished. Matches AddRef() in PrintDocument(); |
413 Release(); | 415 Release(); |
414 } | 416 } |
415 | 417 |
416 void PrintDialogGtk::InitPrintSettings(const PageRanges& page_ranges, | 418 void PrintDialogGtk::InitPrintSettings(const PageRanges& page_ranges, |
417 PrintSettings* settings) { | 419 PrintSettings* settings) { |
418 printing::PrintSettingsInitializerGtk::InitPrintSettings( | 420 printing::PrintSettingsInitializerGtk::InitPrintSettings( |
419 gtk_settings_, page_setup_, page_ranges, false, settings); | 421 gtk_settings_, page_setup_, page_ranges, false, settings); |
420 context_->InitWithSettings(*settings); | 422 context_->InitWithSettings(*settings); |
421 } | 423 } |
OLD | NEW |