| 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_GTK_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_GTK_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_GTK_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <gtk/gtkunixprint.h> | 9 #include <gtk/gtkunixprint.h> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 : public printing::PrintDialogGtkInterface, | 29 : public printing::PrintDialogGtkInterface, |
| 30 public base::RefCountedThreadSafe< | 30 public base::RefCountedThreadSafe< |
| 31 PrintDialogGtk, content::BrowserThread::DeleteOnUIThread> { | 31 PrintDialogGtk, content::BrowserThread::DeleteOnUIThread> { |
| 32 public: | 32 public: |
| 33 // Creates and returns a print dialog. | 33 // Creates and returns a print dialog. |
| 34 static printing::PrintDialogGtkInterface* CreatePrintDialog( | 34 static printing::PrintDialogGtkInterface* CreatePrintDialog( |
| 35 PrintingContextGtk* context); | 35 PrintingContextGtk* context); |
| 36 | 36 |
| 37 // printing::PrintDialogGtkInterface implementation. | 37 // printing::PrintDialogGtkInterface implementation. |
| 38 virtual void UseDefaultSettings() OVERRIDE; | 38 virtual void UseDefaultSettings() OVERRIDE; |
| 39 virtual bool UpdateSettings(const base::DictionaryValue& job_settings, | 39 virtual bool UpdateSettings(bool target_is_pdf, |
| 40 const printing::PageRanges& ranges, | |
| 41 printing::PrintSettings* settings) OVERRIDE; | 40 printing::PrintSettings* settings) OVERRIDE; |
| 42 virtual void ShowDialog( | 41 virtual void ShowDialog( |
| 43 gfx::NativeView parent_view, | 42 gfx::NativeView parent_view, |
| 44 bool has_selection, | 43 bool has_selection, |
| 45 const PrintingContextGtk::PrintSettingsCallback& callback) OVERRIDE; | 44 const PrintingContextGtk::PrintSettingsCallback& callback) OVERRIDE; |
| 46 virtual void PrintDocument(const printing::Metafile* metafile, | 45 virtual void PrintDocument(const printing::Metafile* metafile, |
| 47 const string16& document_name) OVERRIDE; | 46 const string16& document_name) OVERRIDE; |
| 48 virtual void AddRefToDialog() OVERRIDE; | 47 virtual void AddRefToDialog() OVERRIDE; |
| 49 virtual void ReleaseDialog() OVERRIDE; | 48 virtual void ReleaseDialog() OVERRIDE; |
| 50 | 49 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 // Prints document named |document_name|. | 61 // Prints document named |document_name|. |
| 63 void SendDocumentToPrinter(const string16& document_name); | 62 void SendDocumentToPrinter(const string16& document_name); |
| 64 | 63 |
| 65 // Handles print job response. | 64 // Handles print job response. |
| 66 static void OnJobCompletedThunk(GtkPrintJob* print_job, | 65 static void OnJobCompletedThunk(GtkPrintJob* print_job, |
| 67 gpointer user_data, | 66 gpointer user_data, |
| 68 GError* error); | 67 GError* error); |
| 69 void OnJobCompleted(GtkPrintJob* print_job, GError* error); | 68 void OnJobCompleted(GtkPrintJob* print_job, GError* error); |
| 70 | 69 |
| 71 // Helper function for initializing |context_|'s PrintSettings with a given | 70 // Helper function for initializing |context_|'s PrintSettings with a given |
| 72 // set of |page_ranges| and |settings|. | 71 // |settings|. |
| 73 void InitPrintSettings(const printing::PageRanges& page_ranges, | 72 void InitPrintSettings(printing::PrintSettings* settings); |
| 74 printing::PrintSettings* settings); | |
| 75 | 73 |
| 76 // Printing dialog callback. | 74 // Printing dialog callback. |
| 77 PrintingContextGtk::PrintSettingsCallback callback_; | 75 PrintingContextGtk::PrintSettingsCallback callback_; |
| 78 PrintingContextGtk* context_; | 76 PrintingContextGtk* context_; |
| 79 | 77 |
| 80 // Print dialog settings. PrintDialogGtk owns |dialog_| and holds references | 78 // Print dialog settings. PrintDialogGtk owns |dialog_| and holds references |
| 81 // to the other objects. | 79 // to the other objects. |
| 82 GtkWidget* dialog_; | 80 GtkWidget* dialog_; |
| 83 GtkPrintSettings* gtk_settings_; | 81 GtkPrintSettings* gtk_settings_; |
| 84 GtkPageSetup* page_setup_; | 82 GtkPageSetup* page_setup_; |
| 85 GtkPrinter* printer_; | 83 GtkPrinter* printer_; |
| 86 | 84 |
| 87 base::FilePath path_to_pdf_; | 85 base::FilePath path_to_pdf_; |
| 88 | 86 |
| 89 DISALLOW_COPY_AND_ASSIGN(PrintDialogGtk); | 87 DISALLOW_COPY_AND_ASSIGN(PrintDialogGtk); |
| 90 }; | 88 }; |
| 91 | 89 |
| 92 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_GTK_H_ | 90 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_GTK_H_ |
| OLD | NEW |