| 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 PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_ |
| 6 #define PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_ | 6 #define PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_ |
| 7 | 7 |
| 8 #include <ocidl.h> | 8 #include <ocidl.h> |
| 9 #include <commdlg.h> | 9 #include <commdlg.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "printing/printing_context_win.h" | 13 #include "printing/printing_context_win.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 | 15 |
| 16 namespace printing { | 16 namespace printing { |
| 17 | 17 |
| 18 class PRINTING_EXPORT PrintingContextSytemDialogWin | 18 class PRINTING_EXPORT PrintingContextSytemDialogWin |
| 19 : public PrintingContextWin { | 19 : public PrintingContextWin { |
| 20 public: | 20 public: |
| 21 explicit PrintingContextSytemDialogWin(Delegate* delegate); | 21 explicit PrintingContextSytemDialogWin(Delegate* delegate); |
| 22 virtual ~PrintingContextSytemDialogWin(); | 22 virtual ~PrintingContextSytemDialogWin(); |
| 23 | 23 |
| 24 // PrintingContext implementation. | 24 // PrintingContext implementation. |
| 25 virtual void AskUserForSettings( | 25 virtual void AskUserForSettings( |
| 26 int max_pages, | 26 int max_pages, |
| 27 bool has_selection, | 27 bool has_selection, |
| 28 bool is_scripted, |
| 28 const PrintSettingsCallback& callback) override; | 29 const PrintSettingsCallback& callback) override; |
| 29 virtual void Cancel() override; | 30 virtual void Cancel() override; |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 friend class MockPrintingContextWin; | 33 friend class MockPrintingContextWin; |
| 33 | 34 |
| 34 virtual HRESULT ShowPrintDialog(PRINTDLGEX* options); | 35 virtual HRESULT ShowPrintDialog(PRINTDLGEX* options); |
| 35 | 36 |
| 36 // Reads the settings from the selected device context. Updates settings_ and | 37 // Reads the settings from the selected device context. Updates settings_ and |
| 37 // its margins. | 38 // its margins. |
| 38 bool InitializeSettings(const DEVMODE& dev_mode, | 39 bool InitializeSettings(const DEVMODE& dev_mode, |
| 39 const std::wstring& new_device_name, | 40 const std::wstring& new_device_name, |
| 40 const PRINTPAGERANGE* ranges, | 41 const PRINTPAGERANGE* ranges, |
| 41 int number_ranges, | 42 int number_ranges, |
| 42 bool selection_only); | 43 bool selection_only); |
| 43 | 44 |
| 44 // Parses the result of a PRINTDLGEX result. | 45 // Parses the result of a PRINTDLGEX result. |
| 45 Result ParseDialogResultEx(const PRINTDLGEX& dialog_options); | 46 Result ParseDialogResultEx(const PRINTDLGEX& dialog_options); |
| 46 Result ParseDialogResult(const PRINTDLG& dialog_options); | 47 Result ParseDialogResult(const PRINTDLG& dialog_options); |
| 47 | 48 |
| 48 // The dialog box for the time it is shown. | 49 // The dialog box for the time it is shown. |
| 49 volatile HWND dialog_box_; | 50 volatile HWND dialog_box_; |
| 50 | 51 |
| 51 DISALLOW_COPY_AND_ASSIGN(PrintingContextSytemDialogWin); | 52 DISALLOW_COPY_AND_ASSIGN(PrintingContextSytemDialogWin); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace printing | 55 } // namespace printing |
| 55 | 56 |
| 56 #endif // PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_ | 57 #endif // PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_ |
| OLD | NEW |