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

Side by Side Diff: printing/printing_context_cairo.cc

Issue 8046028: Fix issue with print preview on Chrome OS just displaying an error message. (Closed)
Patch Set: Removed extra {} 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
« no previous file with comments | « no previous file | no next file » | 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_cairo.h" 5 #include "printing/printing_context_cairo.h"
6 6
7 // TODO(abodenha@chromium.org) The number of #ifdefs here has gotten too 7 // TODO(abodenha@chromium.org) The number of #ifdefs here has gotten too
8 // large. Refactor this code into separate files for Linux and Chrome OS. 8 // large. Refactor this code into separate files for Linux and Chrome OS.
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 PrintingContext::Result PrintingContextCairo::UpdatePrinterSettings( 143 PrintingContext::Result PrintingContextCairo::UpdatePrinterSettings(
144 const DictionaryValue& job_settings, const PageRanges& ranges) { 144 const DictionaryValue& job_settings, const PageRanges& ranges) {
145 #if defined(OS_CHROMEOS) 145 #if defined(OS_CHROMEOS)
146 bool landscape = false; 146 bool landscape = false;
147 147
148 if (!job_settings.GetBoolean(kSettingLandscape, &landscape)) 148 if (!job_settings.GetBoolean(kSettingLandscape, &landscape))
149 return OnError(); 149 return OnError();
150 150
151 if (settings_.dpi() == 0)
152 UseDefaultSettings();
153
151 settings_.SetOrientation(landscape); 154 settings_.SetOrientation(landscape);
152 settings_.ranges = ranges; 155 settings_.ranges = ranges;
153 156
154 return OK; 157 return OK;
155 #else 158 #else
156 DCHECK(!in_print_job_); 159 DCHECK(!in_print_job_);
157 160
158 if (!print_dialog_) { 161 if (!print_dialog_) {
159 print_dialog_ = create_dialog_func_(this); 162 print_dialog_ = create_dialog_func_(this);
160 print_dialog_->AddRefToDialog(); 163 print_dialog_->AddRefToDialog();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 void PrintingContextCairo::ReleaseContext() { 228 void PrintingContextCairo::ReleaseContext() {
226 // Intentional No-op. 229 // Intentional No-op.
227 } 230 }
228 231
229 gfx::NativeDrawingContext PrintingContextCairo::context() const { 232 gfx::NativeDrawingContext PrintingContextCairo::context() const {
230 // Intentional No-op. 233 // Intentional No-op.
231 return NULL; 234 return NULL;
232 } 235 }
233 236
234 } // namespace printing 237 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698