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

Unified Diff: printing/printing_context_mac.mm

Issue 478183005: Added PrintingContext::Delegate to get parent view handle and application locale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mon Aug 25 23:50:54 PDT 2014 Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/printing_context_mac.h ('k') | printing/printing_context_no_system_dialog.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/printing_context_mac.mm
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
index 9bbe5ac1de9e67198c10f64284577d76dbfac223..fa907b579a44491da33bbac49a4ec2997dc44ba7 100644
--- a/printing/printing_context_mac.mm
+++ b/printing/printing_context_mac.mm
@@ -68,12 +68,12 @@ PMPaper MatchPaper(CFArrayRef paper_list,
} // namespace
// static
-PrintingContext* PrintingContext::Create(const std::string& app_locale) {
- return static_cast<PrintingContext*>(new PrintingContextMac(app_locale));
+scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) {
+ return make_scoped_ptr<PrintingContext>(new PrintingContextMac(delegate));
}
-PrintingContextMac::PrintingContextMac(const std::string& app_locale)
- : PrintingContext(app_locale),
+PrintingContextMac::PrintingContextMac(Delegate* delegate)
+ : PrintingContext(delegate),
print_info_([[NSPrintInfo sharedPrintInfo] copy]),
context_(NULL) {
}
@@ -83,7 +83,6 @@ PrintingContextMac::~PrintingContextMac() {
}
void PrintingContextMac::AskUserForSettings(
- gfx::NativeView parent_view,
int max_pages,
bool has_selection,
const PrintSettingsCallback& callback) {
@@ -115,6 +114,7 @@ void PrintingContextMac::AskUserForSettings(
[panel setOptions:options];
// Set the print job title text.
+ gfx::NativeView parent_view = delegate_->GetParentView();
if (parent_view) {
NSString* job_title = [[parent_view window] title];
if (job_title) {
« no previous file with comments | « printing/printing_context_mac.h ('k') | printing/printing_context_no_system_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698