Delay GetToken/DeleteToken operation until GCMClient is ready.
[chromium-blink-merge.git] / printing / printing_context_system_dialog_win.h
blobbafc478c18583ce319e66a0f2949243b6f19d369
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
3 // found in the LICENSE file.
5 #ifndef PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
6 #define PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
8 #include <ocidl.h>
9 #include <commdlg.h>
11 #include <string>
13 #include "printing/printing_context_win.h"
14 #include "ui/gfx/native_widget_types.h"
16 namespace printing {
18 class PRINTING_EXPORT PrintingContextSytemDialogWin
19 : public PrintingContextWin {
20 public:
21 explicit PrintingContextSytemDialogWin(Delegate* delegate);
22 ~PrintingContextSytemDialogWin() override;
24 // PrintingContext implementation.
25 void AskUserForSettings(
26 int max_pages,
27 bool has_selection,
28 bool is_scripted,
29 const PrintSettingsCallback& callback) override;
31 private:
32 friend class MockPrintingContextWin;
34 virtual HRESULT ShowPrintDialog(PRINTDLGEX* options);
36 // Reads the settings from the selected device context. Updates settings_ and
37 // its margins.
38 bool InitializeSettings(const DEVMODE& dev_mode,
39 const std::wstring& new_device_name,
40 const PRINTPAGERANGE* ranges,
41 int number_ranges,
42 bool selection_only);
44 // Parses the result of a PRINTDLGEX result.
45 Result ParseDialogResultEx(const PRINTDLGEX& dialog_options);
46 Result ParseDialogResult(const PRINTDLG& dialog_options);
48 DISALLOW_COPY_AND_ASSIGN(PrintingContextSytemDialogWin);
51 } // namespace printing
53 #endif // PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_