Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: chrome/browser/printing/print_dialog_gtk.h

Issue 47823002: De-duplicate job_settings parsing code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Noam's comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/printing/print_dialog_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698