| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtkprintjob.h> | 7 #include <gtk/gtkprintjob.h> |
| 8 #include <gtk/gtkprintunixdialog.h> | 8 #include <gtk/gtkprintunixdialog.h> |
| 9 #include <gtk/gtkpagesetupunixdialog.h> | 9 #include <gtk/gtkpagesetupunixdialog.h> |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 void PrintDialogGtk::OnResponse(GtkWidget* dialog, gint response_id) { | 120 void PrintDialogGtk::OnResponse(GtkWidget* dialog, gint response_id) { |
| 121 gtk_widget_hide(dialog_); | 121 gtk_widget_hide(dialog_); |
| 122 | 122 |
| 123 switch (response_id) { | 123 switch (response_id) { |
| 124 case GTK_RESPONSE_OK: { | 124 case GTK_RESPONSE_OK: { |
| 125 GtkPrinter* printer = | 125 GtkPrinter* printer = |
| 126 gtk_print_unix_dialog_get_selected_printer( | 126 gtk_print_unix_dialog_get_selected_printer( |
| 127 GTK_PRINT_UNIX_DIALOG(dialog_)); | 127 GTK_PRINT_UNIX_DIALOG(dialog_)); |
| 128 // Attempt to track down bug 70166. |
| 129 CHECK(printer != NULL); |
| 128 if (!gtk_printer_accepts_pdf(printer)) { | 130 if (!gtk_printer_accepts_pdf(printer)) { |
| 129 browser_->GetSelectedTabContents()->AddInfoBar( | 131 browser_->GetSelectedTabContents()->AddInfoBar( |
| 130 new PdfUnsupportedInfoBarDelegate(browser_)); | 132 new PdfUnsupportedInfoBarDelegate(browser_)); |
| 131 break; | 133 break; |
| 132 } | 134 } |
| 133 | 135 |
| 134 GtkPrintSettings* settings = | 136 GtkPrintSettings* settings = |
| 135 gtk_print_unix_dialog_get_settings( | 137 gtk_print_unix_dialog_get_settings( |
| 136 GTK_PRINT_UNIX_DIALOG(dialog_)); | 138 GTK_PRINT_UNIX_DIALOG(dialog_)); |
| 137 GtkPageSetup* setup = gtk_print_unix_dialog_get_page_setup( | 139 GtkPageSetup* setup = gtk_print_unix_dialog_get_page_setup( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 g_object_unref(job); | 179 g_object_unref(job); |
| 178 | 180 |
| 179 base::FileUtilProxy::Delete( | 181 base::FileUtilProxy::Delete( |
| 180 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), | 182 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 181 path_to_pdf_, | 183 path_to_pdf_, |
| 182 false, | 184 false, |
| 183 NULL); | 185 NULL); |
| 184 | 186 |
| 185 delete this; | 187 delete this; |
| 186 } | 188 } |
| OLD | NEW |