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

Unified Diff: printing/printing_context_win.h

Issue 27441003: Use BaseShellDialog for print dialog on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: printing/printing_context_win.h
diff --git a/printing/printing_context_win.h b/printing/printing_context_win.h
index c54b531b720424f05b9a7f91d1c7deeaf4756701..062afa3d3e954169c77344b03018d252df2d76f4 100644
--- a/printing/printing_context_win.h
+++ b/printing/printing_context_win.h
@@ -14,10 +14,13 @@
#include "build/build_config.h"
#include "printing/printing_context.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/shell_dialogs/print_settings_dialog_win.h"
namespace printing {
-class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
+class PRINTING_EXPORT PrintingContextWin
+ : public PrintingContext,
+ public ui::PrintSettingsDialogWin::Listener {
public:
explicit PrintingContextWin(const std::string& app_locale);
~PrintingContextWin();
@@ -41,6 +44,10 @@ class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
virtual void ReleaseContext() OVERRIDE;
virtual gfx::NativeDrawingContext context() const OVERRIDE;
+ // PrintSettingsDialogWin::Listener implementation:
+ virtual void PrintSettingsConfirmed(PRINTDLGEX* dialog_options) OVERRIDE;
+ virtual void PrintSettingsCancelled(PRINTDLGEX* dialog_options) OVERRIDE;
+
#if defined(UNIT_TEST) || defined(PRINTING_IMPLEMENTATION)
// Sets a fake PrintDlgEx function pointer in tests.
void SetPrintDialog(HRESULT (__stdcall *print_dialog_func)(LPPRINTDLGEX)) {
@@ -88,6 +95,12 @@ class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
// SetPrintDialog() in tests.
HRESULT (__stdcall *print_dialog_func_)(LPPRINTDLGEX);
+ // Where to notify when the dialog is closed.
+ PrintSettingsCallback callback_;
+
+ // Wrapper around native print dialog that runs it on a background thread.
+ scoped_refptr<ui::PrintSettingsDialogWin> print_settings_dialog_;
+
DISALLOW_COPY_AND_ASSIGN(PrintingContextWin);
};

Powered by Google App Engine
This is Rietveld 408576698