OLD | NEW |
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_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 "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 virtual void Cancel(); | 40 virtual void Cancel(); |
41 virtual void ReleaseContext(); | 41 virtual void ReleaseContext(); |
42 virtual gfx::NativeDrawingContext context() const; | 42 virtual gfx::NativeDrawingContext context() const; |
43 | 43 |
44 private: | 44 private: |
45 // Initializes PrintSettings from |print_info_|. This must be called | 45 // Initializes PrintSettings from |print_info_|. This must be called |
46 // after changes to |print_info_| in order for the changes to take effect in | 46 // after changes to |print_info_| in order for the changes to take effect in |
47 // printing. | 47 // printing. |
48 // This function ignores the page range information specified in the print | 48 // This function ignores the page range information specified in the print |
49 // info object and use |ranges| instead. | 49 // info object and use |ranges| instead. |
50 void InitPrintSettingsFromPrintInfo(const PageRanges& ranges); | 50 // Also initializes the header footer strings present in |header_footer_info| |
| 51 // based on the page layout. |
| 52 void InitPrintSettingsFromPrintInfo( |
| 53 const PageRanges& ranges, |
| 54 const base::DictionaryValue& header_footer_info); |
51 | 55 |
52 // Returns the set of page ranges constructed from |print_info_|. | 56 // Returns the set of page ranges constructed from |print_info_|. |
53 PageRanges GetPageRangesFromPrintInfo(); | 57 PageRanges GetPageRangesFromPrintInfo(); |
54 | 58 |
55 // Updates |print_info_| to use the given printer. | 59 // Updates |print_info_| to use the given printer. |
56 // Returns true if the printer was set else returns false. | 60 // Returns true if the printer was set else returns false. |
57 bool SetPrinter(const std::string& device_name); | 61 bool SetPrinter(const std::string& device_name); |
58 | 62 |
59 // Sets |copies| in PMPrintSettings. | 63 // Sets |copies| in PMPrintSettings. |
60 // Returns true if the number of copies is set. | 64 // Returns true if the number of copies is set. |
(...skipping 21 matching lines...) Expand all Loading... |
82 // The current page's context; only valid between NewPage and PageDone call | 86 // The current page's context; only valid between NewPage and PageDone call |
83 // pairs. | 87 // pairs. |
84 CGContext* context_; | 88 CGContext* context_; |
85 | 89 |
86 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); | 90 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); |
87 }; | 91 }; |
88 | 92 |
89 } // namespace printing | 93 } // namespace printing |
90 | 94 |
91 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ | 95 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ |
OLD | NEW |