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

Side by Side Diff: printing/printing_context_mac.h

Issue 6775013: PrintPreview: While printing the preview data, set the initiator tab title as print job name. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated the CL. Created 9 years, 8 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
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"
11 #include "printing/printing_context.h" 11 #include "printing/printing_context.h"
12 12
13 #ifdef __OBJC__ 13 #ifdef __OBJC__
14 @class NSPrintInfo; 14 @class NSPrintInfo;
15 @class NSString;
15 #else 16 #else
16 class NSPrintInfo; 17 class NSPrintInfo;
18 class NSString;
17 #endif // __OBJC__ 19 #endif // __OBJC__
18 20
19 namespace printing { 21 namespace printing {
20 22
21 class PrintingContextMac : public PrintingContext { 23 class PrintingContextMac : public PrintingContext {
22 public: 24 public:
23 explicit PrintingContextMac(const std::string& app_locale); 25 explicit PrintingContextMac(const std::string& app_locale);
24 ~PrintingContextMac(); 26 ~PrintingContextMac();
25 27
26 // PrintingContext implementation. 28 // PrintingContext implementation.
(...skipping 17 matching lines...) Expand all
44 // Read the settings from the given NSPrintInfo (and cache it for later use). 46 // Read the settings from the given NSPrintInfo (and cache it for later use).
45 void ParsePrintInfo(NSPrintInfo* print_info); 47 void ParsePrintInfo(NSPrintInfo* print_info);
46 48
47 // Initializes PrintSettings from native print info object. 49 // Initializes PrintSettings from native print info object.
48 void InitPrintSettingsFromPrintInfo(const PageRanges& ranges); 50 void InitPrintSettingsFromPrintInfo(const PageRanges& ranges);
49 51
50 // Updates |print_info_| to use the given printer. 52 // Updates |print_info_| to use the given printer.
51 // Returns true if the printer was set else returns false. 53 // Returns true if the printer was set else returns false.
52 bool SetPrinter(const std::string& printer_name); 54 bool SetPrinter(const std::string& printer_name);
53 55
56 // Sets print job name.
57 // Returns true if print job name is set else returns false.
stuartmorgan 2011/03/30 22:59:17 "else returns false" is redundant.
58 bool SetPrintJobName(const string16& job_name);
59
60 // Updates |printInfo| with the given |job_name|.
61 void UpdatePrintInfoWithJobName(NSPrintInfo* printInfo, NSString* job_name);
62
54 // The native print info object. 63 // The native print info object.
55 scoped_nsobject<NSPrintInfo> print_info_; 64 scoped_nsobject<NSPrintInfo> print_info_;
56 65
57 // The current page's context; only valid between NewPage and PageDone call 66 // The current page's context; only valid between NewPage and PageDone call
58 // pairs. 67 // pairs.
59 CGContext* context_; 68 CGContext* context_;
60 69
61 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); 70 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac);
62 }; 71 };
63 72
64 } // namespace printing 73 } // namespace printing
65 74
66 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ 75 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698