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

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: rebase 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
« no previous file with comments | « printing/printing.gyp ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context_win.h
diff --git a/printing/printing_context_win.h b/printing/printing_context_win.h
index c54b531b720424f05b9a7f91d1c7deeaf4756701..06226b2704fb9c7f59f7eb347eea4d2d8f6b3fc1 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::Observer {
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::Observer 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);
};
« no previous file with comments | « printing/printing.gyp ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698