OLD | NEW |
1 // Copyright (c) 2010 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_MAC_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_MAC_H_ |
6 #define PRINTING_PRINTING_CONTEXT_MAC_H_ | 6 #define PRINTING_PRINTING_CONTEXT_MAC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "printing/printing_context.h" | 10 #include "printing/printing_context.h" |
11 | 11 |
12 #ifdef __OBJC__ | 12 #ifdef __OBJC__ |
13 @class NSPrintInfo; | 13 @class NSPrintInfo; |
14 #else | 14 #else |
15 class NSPrintInfo; | 15 class NSPrintInfo; |
16 #endif // __OBJC__ | 16 #endif // __OBJC__ |
17 | 17 |
18 namespace printing { | 18 namespace printing { |
19 | 19 |
20 class PrintingContextMac : public PrintingContext { | 20 class PrintingContextMac : public PrintingContext { |
21 public: | 21 public: |
22 explicit PrintingContextMac(const std::string& app_locale); | 22 explicit PrintingContextMac(const std::string& app_locale); |
23 ~PrintingContextMac(); | 23 ~PrintingContextMac(); |
24 | 24 |
25 // PrintingContext implementation. | 25 // PrintingContext implementation. |
26 virtual void AskUserForSettings(gfx::NativeView parent_view, | 26 virtual void AskUserForSettings(gfx::NativeView parent_view, |
27 int max_pages, | 27 int max_pages, |
28 bool has_selection, | 28 bool has_selection, |
29 PrintSettingsCallback* callback); | 29 PrintSettingsCallback* callback); |
30 virtual Result UseDefaultSettings(); | 30 virtual Result UseDefaultSettings(); |
| 31 virtual Result UpdatePrintSettings(const DictionaryValue* job_settings, |
| 32 const PageRanges& ranges); |
31 virtual Result InitWithSettings(const PrintSettings& settings); | 33 virtual Result InitWithSettings(const PrintSettings& settings); |
32 virtual Result NewDocument(const string16& document_name); | 34 virtual Result NewDocument(const string16& document_name); |
33 virtual Result NewPage(); | 35 virtual Result NewPage(); |
34 virtual Result PageDone(); | 36 virtual Result PageDone(); |
35 virtual Result DocumentDone(); | 37 virtual Result DocumentDone(); |
36 virtual void Cancel(); | 38 virtual void Cancel(); |
37 virtual void ReleaseContext(); | 39 virtual void ReleaseContext(); |
38 virtual gfx::NativeDrawingContext context() const; | 40 virtual gfx::NativeDrawingContext context() const; |
39 | 41 |
40 private: | 42 private: |
41 // Read the settings from the given NSPrintInfo (and cache it for later use). | 43 // Read the settings from the given NSPrintInfo (and cache it for later use). |
42 void ParsePrintInfo(NSPrintInfo* print_info); | 44 void ParsePrintInfo(NSPrintInfo* print_info); |
43 | 45 |
44 // The native print info object. | 46 // The native print info object. |
45 NSPrintInfo* print_info_; | 47 NSPrintInfo* print_info_; |
46 | 48 |
47 // The current page's context; only valid between NewPage and PageDone call | 49 // The current page's context; only valid between NewPage and PageDone call |
48 // pairs. | 50 // pairs. |
49 CGContext* context_; | 51 CGContext* context_; |
50 | 52 |
51 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); | 53 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); |
52 }; | 54 }; |
53 | 55 |
54 } // namespace printing | 56 } // namespace printing |
55 | 57 |
56 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ | 58 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ |
OLD | NEW |