OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_LIBGTKUI_PRINT_DIALOG_GTK2_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_PRINT_DIALOG_GTK_H_ |
6 #define CHROME_BROWSER_UI_LIBGTKUI_PRINT_DIALOG_GTK2_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_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 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/sequenced_task_runner_helpers.h" | 15 #include "base/sequenced_task_runner_helpers.h" |
16 #include "chrome/browser/ui/libgtkui/gtk2_signal.h" | 16 #include "chrome/browser/ui/libgtkui/gtk_signal.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "printing/print_dialog_gtk_interface.h" | 18 #include "printing/print_dialog_gtk_interface.h" |
19 #include "printing/printing_context_linux.h" | 19 #include "printing/printing_context_linux.h" |
20 #include "ui/aura/window_observer.h" | 20 #include "ui/aura/window_observer.h" |
21 | 21 |
22 namespace printing { | 22 namespace printing { |
23 class MetafilePlayer; | 23 class MetafilePlayer; |
24 class PrintSettings; | 24 class PrintSettings; |
25 } | 25 } |
26 | 26 |
27 using printing::PrintingContextLinux; | 27 using printing::PrintingContextLinux; |
28 | 28 |
29 // Needs to be freed on the UI thread to clean up its GTK members variables. | 29 // Needs to be freed on the UI thread to clean up its GTK members variables. |
30 class PrintDialogGtk2 | 30 class PrintDialogGtk2 : public printing::PrintDialogGtkInterface, |
31 : public printing::PrintDialogGtkInterface, | 31 public base::RefCountedThreadSafe< |
32 public base::RefCountedThreadSafe< | 32 PrintDialogGtk2, |
33 PrintDialogGtk2, content::BrowserThread::DeleteOnUIThread>, | 33 content::BrowserThread::DeleteOnUIThread>, |
34 public aura::WindowObserver { | 34 public aura::WindowObserver { |
35 public: | 35 public: |
36 // Creates and returns a print dialog. | 36 // Creates and returns a print dialog. |
37 static printing::PrintDialogGtkInterface* CreatePrintDialog( | 37 static printing::PrintDialogGtkInterface* CreatePrintDialog( |
38 PrintingContextLinux* context); | 38 PrintingContextLinux* context); |
39 | 39 |
40 // printing::PrintDialogGtkInterface implementation. | 40 // printing::PrintDialogGtkInterface implementation. |
41 void UseDefaultSettings() override; | 41 void UseDefaultSettings() override; |
42 bool UpdateSettings(printing::PrintSettings* settings) override; | 42 bool UpdateSettings(printing::PrintSettings* settings) override; |
43 void ShowDialog( | 43 void ShowDialog( |
44 gfx::NativeView parent_view, | 44 gfx::NativeView parent_view, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 GtkWidget* dialog_; | 82 GtkWidget* dialog_; |
83 GtkPrintSettings* gtk_settings_; | 83 GtkPrintSettings* gtk_settings_; |
84 GtkPageSetup* page_setup_; | 84 GtkPageSetup* page_setup_; |
85 GtkPrinter* printer_; | 85 GtkPrinter* printer_; |
86 | 86 |
87 base::FilePath path_to_pdf_; | 87 base::FilePath path_to_pdf_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(PrintDialogGtk2); | 89 DISALLOW_COPY_AND_ASSIGN(PrintDialogGtk2); |
90 }; | 90 }; |
91 | 91 |
92 #endif // CHROME_BROWSER_UI_LIBGTKUI_PRINT_DIALOG_GTK2_H_ | 92 #endif // CHROME_BROWSER_UI_LIBGTKUI_PRINT_DIALOG_GTK_H_ |
OLD | NEW |