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

Side by Side Diff: printing/printing_context_mac.mm

Issue 740983002: Implement window.print() on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « printing/printing_context_mac.h ('k') | printing/printing_context_no_system_dialog.h » ('j') | no next file with comments »
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 #include "printing/printing_context_mac.h" 5 #include "printing/printing_context_mac.h"
6 6
7 #import <ApplicationServices/ApplicationServices.h> 7 #import <ApplicationServices/ApplicationServices.h>
8 #import <AppKit/AppKit.h> 8 #import <AppKit/AppKit.h>
9 9
10 #import <iomanip> 10 #import <iomanip>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 context_(NULL) { 78 context_(NULL) {
79 } 79 }
80 80
81 PrintingContextMac::~PrintingContextMac() { 81 PrintingContextMac::~PrintingContextMac() {
82 ReleaseContext(); 82 ReleaseContext();
83 } 83 }
84 84
85 void PrintingContextMac::AskUserForSettings( 85 void PrintingContextMac::AskUserForSettings(
86 int max_pages, 86 int max_pages,
87 bool has_selection, 87 bool has_selection,
88 bool is_scripted,
88 const PrintSettingsCallback& callback) { 89 const PrintSettingsCallback& callback) {
89 // Third-party print drivers seem to be an area prone to raising exceptions. 90 // Third-party print drivers seem to be an area prone to raising exceptions.
90 // This will allow exceptions to be raised, but does not handle them. The 91 // This will allow exceptions to be raised, but does not handle them. The
91 // NSPrintPanel appears to have appropriate NSException handlers. 92 // NSPrintPanel appears to have appropriate NSException handlers.
92 base::mac::ScopedNSExceptionEnabler enabler; 93 base::mac::ScopedNSExceptionEnabler enabler;
93 94
94 // Exceptions can also happen when the NSPrintPanel is being 95 // Exceptions can also happen when the NSPrintPanel is being
95 // deallocated, so it must be autoreleased within this scope. 96 // deallocated, so it must be autoreleased within this scope.
96 base::mac::ScopedNSAutoreleasePool pool; 97 base::mac::ScopedNSAutoreleasePool pool;
97 98
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 void PrintingContextMac::ReleaseContext() { 519 void PrintingContextMac::ReleaseContext() {
519 print_info_.reset(); 520 print_info_.reset();
520 context_ = NULL; 521 context_ = NULL;
521 } 522 }
522 523
523 gfx::NativeDrawingContext PrintingContextMac::context() const { 524 gfx::NativeDrawingContext PrintingContextMac::context() const {
524 return context_; 525 return context_;
525 } 526 }
526 527
527 } // namespace printing 528 } // namespace printing
OLDNEW
« 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