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

Side by Side Diff: printing/printing_context_mac.mm

Issue 8122006: Fix lack of preview when GCP printer is selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 9 years, 2 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_win.cc » ('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 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 DCHECK(!in_print_job_); 104 DCHECK(!in_print_job_);
105 105
106 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start 106 // NOTE: Reset |print_info_| with a copy of |sharedPrintInfo| so as to start
107 // with a clean slate. 107 // with a clean slate.
108 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]); 108 print_info_.reset([[NSPrintInfo sharedPrintInfo] copy]);
109 109
110 bool collate; 110 bool collate;
111 int color; 111 int color;
112 bool landscape; 112 bool landscape;
113 bool print_to_pdf; 113 bool print_to_pdf;
114 bool is_cloud_dialog;
114 int copies; 115 int copies;
115 int duplex_mode; 116 int duplex_mode;
116 std::string device_name; 117 std::string device_name;
117 118
118 if (!job_settings.GetBoolean(kSettingLandscape, &landscape) || 119 if (!job_settings.GetBoolean(kSettingLandscape, &landscape) ||
119 !job_settings.GetBoolean(kSettingCollate, &collate) || 120 !job_settings.GetBoolean(kSettingCollate, &collate) ||
120 !job_settings.GetInteger(kSettingColor, &color) || 121 !job_settings.GetInteger(kSettingColor, &color) ||
121 !job_settings.GetBoolean(kSettingPrintToPDF, &print_to_pdf) || 122 !job_settings.GetBoolean(kSettingPrintToPDF, &print_to_pdf) ||
122 !job_settings.GetInteger(kSettingDuplexMode, &duplex_mode) || 123 !job_settings.GetInteger(kSettingDuplexMode, &duplex_mode) ||
123 !job_settings.GetInteger(kSettingCopies, &copies) || 124 !job_settings.GetInteger(kSettingCopies, &copies) ||
124 !job_settings.GetString(kSettingDeviceName, &device_name)) { 125 !job_settings.GetString(kSettingDeviceName, &device_name) ||
126 !job_settings.GetBoolean(kSettingCloudPrintDialog, &is_cloud_dialog)) {
125 return OnError(); 127 return OnError();
126 } 128 }
127 129
128 bool print_to_cloud = job_settings.HasKey(printing::kSettingCloudPrintId); 130 bool print_to_cloud = job_settings.HasKey(printing::kSettingCloudPrintId);
129 131
130 if (!print_to_pdf && !print_to_cloud) { 132 if (!print_to_pdf && !print_to_cloud && !is_cloud_dialog) {
131 if (!SetPrinter(device_name)) 133 if (!SetPrinter(device_name))
132 return OnError(); 134 return OnError();
133 135
134 if (!SetCopiesInPrintSettings(copies)) 136 if (!SetCopiesInPrintSettings(copies))
135 return OnError(); 137 return OnError();
136 138
137 if (!SetCollateInPrintSettings(collate)) 139 if (!SetCollateInPrintSettings(collate))
138 return OnError(); 140 return OnError();
139 141
140 if (!SetDuplexModeInPrintSettings( 142 if (!SetDuplexModeInPrintSettings(
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 void PrintingContextMac::ReleaseContext() { 379 void PrintingContextMac::ReleaseContext() {
378 print_info_.reset(); 380 print_info_.reset();
379 context_ = NULL; 381 context_ = NULL;
380 } 382 }
381 383
382 gfx::NativeDrawingContext PrintingContextMac::context() const { 384 gfx::NativeDrawingContext PrintingContextMac::context() const {
383 return context_; 385 return context_;
384 } 386 }
385 387
386 } // namespace printing 388 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | printing/printing_context_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698