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

Side by Side Diff: printing/printing_context_mac.h

Issue 7074051: PrintPreview: Modified PrintingContextMac code to use the copy of sharedPrintInfo object. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated comment. Created 9 years, 6 months 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 | « no previous file | printing/printing_context_mac.mm » ('j') | printing/printing_context_mac.mm » ('J')
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_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 24 matching lines...) Expand all
35 virtual Result InitWithSettings(const PrintSettings& settings); 35 virtual Result InitWithSettings(const PrintSettings& settings);
36 virtual Result NewDocument(const string16& document_name); 36 virtual Result NewDocument(const string16& document_name);
37 virtual Result NewPage(); 37 virtual Result NewPage();
38 virtual Result PageDone(); 38 virtual Result PageDone();
39 virtual Result DocumentDone(); 39 virtual Result DocumentDone();
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 // Read the settings from the given NSPrintInfo (and cache it for later use). 45 // Reset the cached |print_info_| with |print_info|.
46 void ParsePrintInfo(NSPrintInfo* print_info); 46 void ResetPrintInfo(NSPrintInfo* print_info);
47 47
48 // Initializes PrintSettings from native print info object. 48 // Initializes PrintSettings from cached print info object.
stuartmorgan 2011/06/02 21:07:20 s/cached print info object/|print_info_|/ I think
kmadhusu 2011/06/02 23:07:00 Done.
49 // This function ignores the page range information specified in the print
50 // info object and use |ranges| instead.
49 void InitPrintSettingsFromPrintInfo(const PageRanges& ranges); 51 void InitPrintSettingsFromPrintInfo(const PageRanges& ranges);
50 52
53 // Returns the set of page ranges constructed from cached print info object.
stuartmorgan 2011/06/02 21:07:20 s/cached print info object/|print_info_|/
kmadhusu 2011/06/02 23:07:00 Done.
54 PageRanges GetPageRangesFromPrintInfo();
55
51 // Updates |print_info_| to use the given printer. 56 // Updates |print_info_| to use the given printer.
52 // Returns true if the printer was set else returns false. 57 // Returns true if the printer was set else returns false.
53 bool SetPrinter(const std::string& device_name); 58 bool SetPrinter(const std::string& device_name);
54 59
55 // Sets |copies| in PMPrintSettings. 60 // Sets |copies| in PMPrintSettings.
56 // Returns true if the number of copies is set. 61 // Returns true if the number of copies is set.
57 bool SetCopiesInPrintSettings(int copies); 62 bool SetCopiesInPrintSettings(int copies);
58 63
59 // Sets |collate| in PMPrintSettings. 64 // Sets |collate| in PMPrintSettings.
60 // Returns true if |collate| is set. 65 // Returns true if |collate| is set.
(...skipping 17 matching lines...) Expand all
78 // The current page's context; only valid between NewPage and PageDone call 83 // The current page's context; only valid between NewPage and PageDone call
79 // pairs. 84 // pairs.
80 CGContext* context_; 85 CGContext* context_;
81 86
82 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); 87 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac);
83 }; 88 };
84 89
85 } // namespace printing 90 } // namespace printing
86 91
87 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ 92 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | printing/printing_context_mac.mm » ('j') | printing/printing_context_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698