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

Side by Side Diff: printing/printing_context_win.h

Issue 8549031: base::Bind: Convert PrintingContext::PrintSettingsCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « printing/printing_context_no_system_dialog.cc ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WIN_H_ 5 #ifndef PRINTING_PRINTING_CONTEXT_WIN_H_
6 #define PRINTING_PRINTING_CONTEXT_WIN_H_ 6 #define PRINTING_PRINTING_CONTEXT_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 "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 #include "printing/printing_context.h" 15 #include "printing/printing_context.h"
16 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
17 17
18 namespace printing { 18 namespace printing {
19 19
20 class PRINTING_EXPORT PrintingContextWin : public PrintingContext { 20 class PRINTING_EXPORT PrintingContextWin : public PrintingContext {
21 public: 21 public:
22 explicit PrintingContextWin(const std::string& app_locale); 22 explicit PrintingContextWin(const std::string& app_locale);
23 ~PrintingContextWin(); 23 ~PrintingContextWin();
24 24
25 // PrintingContext implementation. 25 // PrintingContext implementation.
26 virtual void AskUserForSettings(gfx::NativeView parent_view, 26 virtual void AskUserForSettings(
27 int max_pages, 27 gfx::NativeView parent_view,
28 bool has_selection, 28 int max_pages,
29 PrintSettingsCallback* callback); 29 bool has_selection,
30 virtual Result UseDefaultSettings(); 30 const PrintSettingsCallback& callback) OVERRIDE;
31 virtual Result UseDefaultSettings() OVERRIDE;
31 virtual Result UpdatePrinterSettings( 32 virtual Result UpdatePrinterSettings(
32 const base::DictionaryValue& job_settings, 33 const base::DictionaryValue& job_settings,
33 const PageRanges& ranges); 34 const PageRanges& ranges) OVERRIDE;
34 virtual Result InitWithSettings(const PrintSettings& settings); 35 virtual Result InitWithSettings(const PrintSettings& settings) OVERRIDE;
35 virtual Result NewDocument(const string16& document_name); 36 virtual Result NewDocument(const string16& document_name) OVERRIDE;
36 virtual Result NewPage(); 37 virtual Result NewPage() OVERRIDE;
37 virtual Result PageDone(); 38 virtual Result PageDone() OVERRIDE;
38 virtual Result DocumentDone(); 39 virtual Result DocumentDone() OVERRIDE;
39 virtual void Cancel(); 40 virtual void Cancel() OVERRIDE;
40 virtual void ReleaseContext(); 41 virtual void ReleaseContext() OVERRIDE;
41 virtual gfx::NativeDrawingContext context() const; 42 virtual gfx::NativeDrawingContext context() const OVERRIDE;
42 43
43 #if defined(UNIT_TEST) || defined(PRINTING_IMPLEMENTATION) 44 #if defined(UNIT_TEST) || defined(PRINTING_IMPLEMENTATION)
44 // Sets a fake PrintDlgEx function pointer in tests. 45 // Sets a fake PrintDlgEx function pointer in tests.
45 void SetPrintDialog(HRESULT (__stdcall *print_dialog_func)(LPPRINTDLGEX)) { 46 void SetPrintDialog(HRESULT (__stdcall *print_dialog_func)(LPPRINTDLGEX)) {
46 print_dialog_func_ = print_dialog_func; 47 print_dialog_func_ = print_dialog_func;
47 } 48 }
48 #endif // defined(UNIT_TEST) 49 #endif // defined(UNIT_TEST)
49 50
50 // Allocates the HDC for a specific DEVMODE. 51 // Allocates the HDC for a specific DEVMODE.
51 static bool AllocateContext(const std::wstring& printer_name, 52 static bool AllocateContext(const std::wstring& printer_name,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // Function pointer that defaults to PrintDlgEx. It can be changed using 91 // Function pointer that defaults to PrintDlgEx. It can be changed using
91 // SetPrintDialog() in tests. 92 // SetPrintDialog() in tests.
92 HRESULT (__stdcall *print_dialog_func_)(LPPRINTDLGEX); 93 HRESULT (__stdcall *print_dialog_func_)(LPPRINTDLGEX);
93 94
94 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); 95 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin);
95 }; 96 };
96 97
97 } // namespace printing 98 } // namespace printing
98 99
99 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ 100 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_
OLDNEW
« no previous file with comments | « printing/printing_context_no_system_dialog.cc ('k') | printing/printing_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698